r95986 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r95985‎ | r95986 | r95987 >
Date:13:55, 1 September 2011
Author:freakolowsky
Status:ok
Tags:
Comment:
* updated oracle schema to current
* updater tested, installer untested(but should work :) )
Modified paths:
  • /trunk/phase3/includes/installer/OracleUpdater.php (modified) (history)
  • /trunk/phase3/maintenance/oracle/archives/patch-globalinterwiki.sql (added) (history)
  • /trunk/phase3/maintenance/oracle/archives/patch-globalnamespaces.sql (added) (history)
  • /trunk/phase3/maintenance/oracle/archives/patch-globaltemplatelinks.sql (added) (history)
  • /trunk/phase3/maintenance/oracle/archives/patch-logging_type_action_index.sql (added) (history)
  • /trunk/phase3/maintenance/oracle/archives/patch-uploadstash.sql (added) (history)
  • /trunk/phase3/maintenance/oracle/archives/patch-user_email_index.sql (modified) (history)
  • /trunk/phase3/maintenance/oracle/archives/patch-user_former_groups.sql (added) (history)
  • /trunk/phase3/maintenance/oracle/tables.sql (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/oracle/archives/patch-globalinterwiki.sql
@@ -0,0 +1,8 @@
 2+define mw_prefix='{$wgDBprefix}';
 3+
 4+CREATE TABLE &mw_prefix.globalinterwiki (
 5+ giw_wikiid VARCHAR2(64) NOT NULL,
 6+ giw_prefix VARCHAR2(32) NOT NULL
 7+);
 8+CREATE UNIQUE INDEX &mw_prefix.globalinterwiki_u01 ON &mw_prefix.globalinterwiki (giw_wikiid, giw_prefix);
 9+
Property changes on: trunk/phase3/maintenance/oracle/archives/patch-globalinterwiki.sql
___________________________________________________________________
Added: svn:eol-style
110 + native
Index: trunk/phase3/maintenance/oracle/archives/patch-uploadstash.sql
@@ -0,0 +1,25 @@
 2+define mw_prefix='{$wgDBprefix}';
 3+
 4+CREATE SEQUENCE uploadstash_us_id_seq;
 5+CREATE TABLE &mw_prefix.uploadstash (
 6+ us_id NUMBER NOT NULL,
 7+ us_user NUMBER DEFAULT 0 NOT NULL,
 8+ us_key VARCHAR2(255) NOT NULL,
 9+ us_orig_path VARCHAR2(255) NOT NULL,
 10+ us_path VARCHAR2(255) NOT NULL,
 11+ us_source_type VARCHAR2(50),
 12+ us_timestamp TIMESTAMP(6) WITH TIME ZONE,
 13+ us_status VARCHAR2(50) NOT NULL,
 14+ us_size NUMBER NOT NULL,
 15+ us_sha1 VARCHAR2(32) NOT NULL,
 16+ us_mime VARCHAR2(255),
 17+ us_media_type VARCHAR2(32) DEFAULT NULL,
 18+ us_image_width NUMBER,
 19+ us_image_height NUMBER,
 20+ us_image_bits NUMBER
 21+);
 22+ALTER TABLE &mw_prefix.uploadstash ADD CONSTRAINT &mw_prefix.uploadstash_pk PRIMARY KEY (us_id);
 23+ALTER TABLE &mw_prefix.uploadstash ADD CONSTRAINT &mw_prefix.uploadstash_fk1 FOREIGN KEY (us_user) REFERENCES &mw_prefix.mwuser(user_id) ON DELETE SET NULL DEFERRABLE INITIALLY DEFERRED;
 24+CREATE INDEX &mw_prefix.uploadstash_i01 ON &mw_prefix.uploadstash (us_user);
 25+CREATE INDEX &mw_prefix.uploadstash_i02 ON &mw_prefix.uploadstash (us_timestamp);
 26+CREATE UNIQUE INDEX &mw_prefix.uploadstash_u01 ON &mw_prefix.uploadstash (us_key);
Property changes on: trunk/phase3/maintenance/oracle/archives/patch-uploadstash.sql
___________________________________________________________________
Added: svn:eol-style
127 + native
Index: trunk/phase3/maintenance/oracle/archives/patch-user_former_groups.sql
@@ -0,0 +1,9 @@
 2+define mw_prefix='{$wgDBprefix}';
 3+
 4+CREATE TABLE &mw_prefix.user_former_groups (
 5+ ufg_user NUMBER DEFAULT 0 NOT NULL,
 6+ ufg_group VARCHAR2(16) NOT NULL
 7+);
 8+ALTER TABLE &mw_prefix.user_former_groups ADD CONSTRAINT &mw_prefix.user_former_groups_fk1 FOREIGN KEY (ufg_user) REFERENCES &mw_prefix.mwuser(user_id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED;
 9+CREATE UNIQUE INDEX &mw_prefix.user_former_groups_u01 ON &mw_prefix.user_former_groups (ufg_user,ufg_group);
 10+
Property changes on: trunk/phase3/maintenance/oracle/archives/patch-user_former_groups.sql
___________________________________________________________________
Added: svn:eol-style
111 + native
Index: trunk/phase3/maintenance/oracle/archives/patch-globaltemplatelinks.sql
@@ -0,0 +1,15 @@
 2+define mw_prefix='{$wgDBprefix}';
 3+
 4+CREATE TABLE &mw_prefix.globaltemplatelinks (
 5+ gtl_from_wiki VARCHAR2(64) NOT NULL,
 6+ gtl_from_page NUMBER NOT NULL,
 7+ gtl_from_namespace NUMBER NOT NULL,
 8+ gtl_from_title VARCHAR2(255) NOT NULL,
 9+ gtl_to_prefix VARCHAR2(32) NOT NULL,
 10+ gtl_to_namespace NUMBER NOT NULL,
 11+ gtl_to_namespacetext VARCHAR2(255) NOT NULL,
 12+ gtl_to_title VARCHAR2(255) NOT NULL
 13+);
 14+CREATE UNIQUE INDEX &mw_prefix.globaltemplatelinks_u01 ON &mw_prefix.globaltemplatelinks (gtl_to_prefix, gtl_to_namespace, gtl_to_title, gtl_from_wiki, gtl_from_page);
 15+CREATE UNIQUE INDEX &mw_prefix.globaltemplatelinks_u02 ON &mw_prefix.globaltemplatelinks (gtl_from_wiki, gtl_from_page, gtl_to_prefix, gtl_to_namespace, gtl_to_title);
 16+
Property changes on: trunk/phase3/maintenance/oracle/archives/patch-globaltemplatelinks.sql
___________________________________________________________________
Added: svn:eol-style
117 + native
Index: trunk/phase3/maintenance/oracle/archives/patch-globalnamespaces.sql
@@ -0,0 +1,9 @@
 2+define mw_prefix='{$wgDBprefix}';
 3+
 4+CREATE TABLE &mw_prefix.globalnamespaces (
 5+ gn_wiki VARCHAR2(64) NOT NULL,
 6+ gn_namespace NUMBER NOT NULL,
 7+ gn_namespacetext VARCHAR2(255) NOT NULL
 8+);
 9+CREATE UNIQUE INDEX &mw_prefix.globalnamespaces_u01 ON &mw_prefix.globalnamespaces (gn_wiki, gn_namespace, gn_namespacetext);
 10+
Property changes on: trunk/phase3/maintenance/oracle/archives/patch-globalnamespaces.sql
___________________________________________________________________
Added: svn:eol-style
111 + native
Index: trunk/phase3/maintenance/oracle/archives/patch-logging_type_action_index.sql
@@ -0,0 +1,4 @@
 2+define mw_prefix='{$wgDBprefix}';
 3+
 4+CREATE INDEX &mw_prefix.logging_i05 ON &mw_prefix.logging (log_type, log_action, log_timestamp);
 5+
Property changes on: trunk/phase3/maintenance/oracle/archives/patch-logging_type_action_index.sql
___________________________________________________________________
Added: svn:eol-style
16 + native
Index: trunk/phase3/maintenance/oracle/archives/patch-user_email_index.sql
@@ -1,4 +1,4 @@
22 define mw_prefix='{$wgDBprefix}';
33
4 -CREATE INDEX &mw_prefix.mwuser_i02 ON &mw_prefix.mwuser (user_email, user_name);
 4+CREATE INDEX &mw_prefix.mwuser_i02 ON &mw_prefix.mwuser (user_email);
55
Index: trunk/phase3/maintenance/oracle/tables.sql
@@ -37,6 +37,17 @@
3838 CREATE UNIQUE INDEX &mw_prefix.user_groups_u01 ON &mw_prefix.user_groups (ug_user,ug_group);
3939 CREATE INDEX &mw_prefix.user_groups_i01 ON &mw_prefix.user_groups (ug_group);
4040
 41+CREATE TABLE &mw_prefix.user_former_groups (
 42+ ufg_user NUMBER DEFAULT 0 NOT NULL,
 43+ ufg_group VARCHAR2(16) NOT NULL
 44+);
 45+ALTER TABLE &mw_prefix.user_former_groups ADD CONSTRAINT &mw_prefix.user_former_groups_fk1 FOREIGN KEY (ufg_user) REFERENCES &mw_prefix.mwuser(user_id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED;
 46+CREATE UNIQUE INDEX &mw_prefix.user_former_groups_u01 ON &mw_prefix.user_former_groups (ufg_user,ufg_group);
 47+
 48+
 49+CREATE UNIQUE INDEX /*i*/ufg_user_group ON /*_*/user_former_groups (ufg_user,ufg_group);
 50+
 51+
4152 CREATE TABLE &mw_prefix.user_newtalk (
4253 user_id NUMBER DEFAULT 0 NOT NULL,
4354 user_ip VARCHAR2(40) NULL,
@@ -355,6 +366,30 @@
356367 CREATE INDEX &mw_prefix.filearchive_i03 ON &mw_prefix.filearchive (fa_deleted_timestamp);
357368 CREATE INDEX &mw_prefix.filearchive_i04 ON &mw_prefix.filearchive (fa_user_text,fa_timestamp);
358369
 370+CREATE SEQUENCE uploadstash_us_id_seq;
 371+CREATE TABLE &mw_prefix.uploadstash (
 372+ us_id NUMBER NOT NULL,
 373+ us_user NUMBER DEFAULT 0 NOT NULL,
 374+ us_key VARCHAR2(255) NOT NULL,
 375+ us_orig_path VARCHAR2(255) NOT NULL,
 376+ us_path VARCHAR2(255) NOT NULL,
 377+ us_source_type VARCHAR2(50),
 378+ us_timestamp TIMESTAMP(6) WITH TIME ZONE,
 379+ us_status VARCHAR2(50) NOT NULL,
 380+ us_size NUMBER NOT NULL,
 381+ us_sha1 VARCHAR2(32) NOT NULL,
 382+ us_mime VARCHAR2(255),
 383+ us_media_type VARCHAR2(32) DEFAULT NULL,
 384+ us_image_width NUMBER,
 385+ us_image_height NUMBER,
 386+ us_image_bits NUMBER
 387+);
 388+ALTER TABLE &mw_prefix.uploadstash ADD CONSTRAINT &mw_prefix.uploadstash_pk PRIMARY KEY (us_id);
 389+ALTER TABLE &mw_prefix.uploadstash ADD CONSTRAINT &mw_prefix.uploadstash_fk1 FOREIGN KEY (us_user) REFERENCES &mw_prefix.mwuser(user_id) ON DELETE SET NULL DEFERRABLE INITIALLY DEFERRED;
 390+CREATE INDEX &mw_prefix.uploadstash_i01 ON &mw_prefix.uploadstash (us_user);
 391+CREATE INDEX &mw_prefix.uploadstash_i02 ON &mw_prefix.uploadstash (us_timestamp);
 392+CREATE UNIQUE INDEX &mw_prefix.uploadstash_u01 ON &mw_prefix.uploadstash (us_key);
 393+
359394 CREATE SEQUENCE recentchanges_rc_id_seq;
360395 CREATE TABLE &mw_prefix.recentchanges (
361396 rc_id NUMBER NOT NULL,
@@ -467,6 +502,7 @@
468503 CREATE INDEX &mw_prefix.logging_i02 ON &mw_prefix.logging (log_user, log_timestamp);
469504 CREATE INDEX &mw_prefix.logging_i03 ON &mw_prefix.logging (log_namespace, log_title, log_timestamp);
470505 CREATE INDEX &mw_prefix.logging_i04 ON &mw_prefix.logging (log_timestamp);
 506+CREATE INDEX &mw_prefix.logging_i05 ON &mw_prefix.logging (log_type, log_action, log_timestamp);
471507
472508 CREATE TABLE &mw_prefix.log_search (
473509 ls_field VARCHAR2(32) NOT NULL,
@@ -644,7 +680,32 @@
645681 ALTER TABLE &mw_prefix.config ADD CONSTRAINT &mw_prefix.config_pk PRIMARY KEY (cf_name);
646682 -- leaving index out for now ...
647683
 684+CREATE TABLE &mw_prefix.globaltemplatelinks (
 685+ gtl_from_wiki VARCHAR2(64) NOT NULL,
 686+ gtl_from_page NUMBER NOT NULL,
 687+ gtl_from_namespace NUMBER NOT NULL,
 688+ gtl_from_title VARCHAR2(255) NOT NULL,
 689+ gtl_to_prefix VARCHAR2(32) NOT NULL,
 690+ gtl_to_namespace NUMBER NOT NULL,
 691+ gtl_to_namespacetext VARCHAR2(255) NOT NULL,
 692+ gtl_to_title VARCHAR2(255) NOT NULL
 693+);
 694+CREATE UNIQUE INDEX &mw_prefix.globaltemplatelinks_u01 ON &mw_prefix.globaltemplatelinks (gtl_to_prefix, gtl_to_namespace, gtl_to_title, gtl_from_wiki, gtl_from_page);
 695+CREATE UNIQUE INDEX &mw_prefix.globaltemplatelinks_u02 ON &mw_prefix.globaltemplatelinks (gtl_from_wiki, gtl_from_page, gtl_to_prefix, gtl_to_namespace, gtl_to_title);
648696
 697+CREATE TABLE &mw_prefix.globalnamespaces (
 698+ gn_wiki VARCHAR2(64) NOT NULL,
 699+ gn_namespace NUMBER NOT NULL,
 700+ gn_namespacetext VARCHAR2(255) NOT NULL
 701+);
 702+CREATE UNIQUE INDEX &mw_prefix.globalnamespaces_u01 ON &mw_prefix.globalnamespaces (gn_wiki, gn_namespace, gn_namespacetext);
 703+
 704+CREATE TABLE &mw_prefix.globalinterwiki (
 705+ giw_wikiid VARCHAR2(64) NOT NULL,
 706+ giw_prefix VARCHAR2(32) NOT NULL
 707+);
 708+CREATE UNIQUE INDEX &mw_prefix.globalinterwiki_u01 ON &mw_prefix.globalinterwiki (giw_wikiid, giw_prefix);
 709+
649710 -- do not prefix this table as it breaks parserTests
650711 CREATE TABLE wiki_field_info_full (
651712 table_name VARCHAR2(35) NOT NULL,
Index: trunk/phase3/includes/installer/OracleUpdater.php
@@ -30,14 +30,20 @@
3131 array( 'doSchemaUpgrade17' ),
3232 array( 'doInsertPage0' ),
3333 array( 'doRemoveNotNullEmptyDefaults' ),
 34+ array( 'addTable', 'user_former_groups', 'patch-user_former_groups.sql' ),
3435
3536 //1.18
3637 array( 'addIndex', 'user', 'i02', 'patch-user_email_index.sql' ),
3738 array( 'modifyField', 'user_properties', 'up_property', 'patch-up_property.sql' ),
 39+ array( 'addTable', 'uploadstash', 'patch-uploadstash.sql' ),
3840
39 - // 1.19
 41+ //1.19
4042 array( 'addTable', 'config', 'patch-config.sql' ),
41 -
 43+ array( 'addIndex', 'logging', 'i05', 'patch-logging_type_action_index.sql'),
 44+ array( 'addTable', 'globaltemplatelinks', 'patch-globaltemplatelinks.sql' ),
 45+ array( 'addTable', 'globalnamespaces', 'patch-globalnamespaces.sql' ),
 46+ array( 'addTable', 'globalinterwiki', 'patch-globalinterwiki.sql' ),
 47+
4248 // till 2.0 i guess
4349 array( 'doRebuildDuplicateFunction' ),
4450

Follow-up revisions

RevisionCommit summaryAuthorDate
r96091* MFT of 1.18 relevant part of r95986freakolowsky11:26, 2 September 2011

Status & tagging log