diff options
Diffstat (limited to 'maintenance/archives')
70 files changed, 246 insertions, 136 deletions
diff --git a/maintenance/archives/patch-archive-ar_content_format.sql b/maintenance/archives/patch-archive-ar_content_format.sql new file mode 100644 index 00000000..81f9fca8 --- /dev/null +++ b/maintenance/archives/patch-archive-ar_content_format.sql @@ -0,0 +1,2 @@ +ALTER TABLE /*$wgDBprefix*/archive + ADD ar_content_format varbinary(64) DEFAULT NULL; diff --git a/maintenance/archives/patch-archive-ar_content_model.sql b/maintenance/archives/patch-archive-ar_content_model.sql new file mode 100644 index 00000000..1a8b630e --- /dev/null +++ b/maintenance/archives/patch-archive-ar_content_model.sql @@ -0,0 +1,2 @@ +ALTER TABLE /*$wgDBprefix*/archive + ADD ar_content_model varbinary(32) DEFAULT NULL; diff --git a/maintenance/archives/patch-archive-user-index.sql b/maintenance/archives/patch-archive-user-index.sql index 62baa2dd..997b4a97 100644 --- a/maintenance/archives/patch-archive-user-index.sql +++ b/maintenance/archives/patch-archive-user-index.sql @@ -1,4 +1,4 @@ -- Adds a user,timestamp index to the archive table -- Used for browsing deleted contributions and renames -ALTER TABLE /*$wgDBprefix*/archive +ALTER TABLE /*$wgDBprefix*/archive ADD INDEX usertext_timestamp ( ar_user_text , ar_timestamp ); diff --git a/maintenance/archives/patch-backlinkindexes.sql b/maintenance/archives/patch-backlinkindexes.sql index 5facd9ea..22cc5871 100644 --- a/maintenance/archives/patch-backlinkindexes.sql +++ b/maintenance/archives/patch-backlinkindexes.sql @@ -1,10 +1,10 @@ --- +-- -- patch-backlinkindexes.sql --- +-- -- Per bug 6440 / http://bugzilla.wikimedia.org/show_bug.cgi?id=6440 -- -- Improve performance of the "what links here"-type queries --- +-- ALTER TABLE /*$wgDBprefix*/pagelinks DROP INDEX pl_namespace, @@ -13,7 +13,7 @@ ALTER TABLE /*$wgDBprefix*/pagelinks ALTER TABLE /*$wgDBprefix*/templatelinks DROP INDEX tl_namespace, ADD INDEX tl_namespace(tl_namespace, tl_title, tl_from); - + ALTER TABLE /*$wgDBprefix*/imagelinks DROP INDEX il_to, ADD INDEX il_to(il_to, il_from); diff --git a/maintenance/archives/patch-category.sql b/maintenance/archives/patch-category.sql index 416500c3..97a5690d 100644 --- a/maintenance/archives/patch-category.sql +++ b/maintenance/archives/patch-category.sql @@ -8,7 +8,7 @@ CREATE TABLE /*$wgDBprefix*/category ( cat_files int signed NOT NULL default 0, cat_hidden tinyint(1) unsigned NOT NULL default 0, - + PRIMARY KEY (cat_id), UNIQUE KEY (cat_title), diff --git a/maintenance/archives/patch-categorylinks.sql b/maintenance/archives/patch-categorylinks.sql index 02168d7f..0af0cf91 100644 --- a/maintenance/archives/patch-categorylinks.sql +++ b/maintenance/archives/patch-categorylinks.sql @@ -6,7 +6,7 @@ CREATE TABLE /*$wgDBprefix*/categorylinks ( -- Key to page_id of the page defined as a category member. cl_from int unsigned NOT NULL default '0', - + -- Name of the category. -- This is also the page_title of the category's description page; -- all such pages are in namespace 14 (NS_CATEGORY). @@ -17,20 +17,20 @@ CREATE TABLE /*$wgDBprefix*/categorylinks ( -- isn't always ideal, but collations seem to be an exciting -- and dangerous new world in MySQL... -- - -- Truncate so that the cl_sortkey key fits in 1000 bytes + -- Truncate so that the cl_sortkey key fits in 1000 bytes -- (MyISAM 5 with server_character_set=utf8) cl_sortkey varchar(70) binary NOT NULL default '', - + -- This isn't really used at present. Provided for an optional -- sorting method by approximate addition time. cl_timestamp timestamp NOT NULL, - + UNIQUE KEY cl_from(cl_from,cl_to), - + -- This key is trouble. It's incomplete, AND it's too big -- when collation is set to UTF-8. Bleeeacch! KEY cl_sortkey(cl_to,cl_sortkey), - + -- Not really used? KEY cl_timestamp(cl_to,cl_timestamp) diff --git a/maintenance/archives/patch-categorylinksindex.sql b/maintenance/archives/patch-categorylinksindex.sql index 8a9ff123..24ad84fe 100644 --- a/maintenance/archives/patch-categorylinksindex.sql +++ b/maintenance/archives/patch-categorylinksindex.sql @@ -1,10 +1,10 @@ --- +-- -- patch-categorylinksindex.sql --- +-- -- Per bug 10280 / http://bugzilla.wikimedia.org/show_bug.cgi?id=10280 -- -- Improve enum continuation performance of the what pages belong to a category query --- +-- ALTER TABLE /*$wgDBprefix*/categorylinks DROP INDEX cl_sortkey, diff --git a/maintenance/archives/patch-drop-ss_admins.sql b/maintenance/archives/patch-drop-ss_admins.sql new file mode 100644 index 00000000..13c3d3b0 --- /dev/null +++ b/maintenance/archives/patch-drop-ss_admins.sql @@ -0,0 +1,2 @@ +-- field is deprecated and no longer updated as of 1.5 +ALTER TABLE /*_*/site_stats DROP COLUMN ss_admins;
\ No newline at end of file diff --git a/maintenance/archives/patch-externallinks.sql b/maintenance/archives/patch-externallinks.sql index 0a4768ca..fc5017db 100644 --- a/maintenance/archives/patch-externallinks.sql +++ b/maintenance/archives/patch-externallinks.sql @@ -5,7 +5,7 @@ CREATE TABLE /*$wgDBprefix*/externallinks ( el_from int(8) unsigned NOT NULL default '0', el_to blob NOT NULL, el_index blob NOT NULL, - + KEY (el_from, el_to(40)), KEY (el_to(60), el_from), KEY (el_index(60)) diff --git a/maintenance/archives/patch-fa_deleted.sql b/maintenance/archives/patch-fa_deleted.sql index 3483f8cf..7ab65239 100644 --- a/maintenance/archives/patch-fa_deleted.sql +++ b/maintenance/archives/patch-fa_deleted.sql @@ -1,3 +1,3 @@ -- Adding fa_deleted field for additional content suppression -ALTER TABLE /*$wgDBprefix*/filearchive +ALTER TABLE /*$wgDBprefix*/filearchive ADD fa_deleted tinyint unsigned NOT NULL default '0'; diff --git a/maintenance/archives/patch-fa_sha1.sql b/maintenance/archives/patch-fa_sha1.sql new file mode 100644 index 00000000..931bc44d --- /dev/null +++ b/maintenance/archives/patch-fa_sha1.sql @@ -0,0 +1,4 @@ +-- Add fa_sha1 and related index +ALTER TABLE /*$wgDBprefix*/filearchive + ADD COLUMN fa_sha1 varbinary(32) NOT NULL default ''; +CREATE INDEX /*i*/fa_sha1 ON /*$wgDBprefix*/filearchive (fa_sha1(10)); diff --git a/maintenance/archives/patch-filearchive-user-index.sql b/maintenance/archives/patch-filearchive-user-index.sql index c79000ad..0d8c3ab1 100644 --- a/maintenance/archives/patch-filearchive-user-index.sql +++ b/maintenance/archives/patch-filearchive-user-index.sql @@ -1,5 +1,5 @@ -- Adding index to sort by uploader -ALTER TABLE /*$wgDBprefix*/filearchive +ALTER TABLE /*$wgDBprefix*/filearchive ADD INDEX fa_user_timestamp (fa_user_text,fa_timestamp), -- Remove useless, incomplete index DROP INDEX fa_deleted_user; diff --git a/maintenance/archives/patch-filearchive.sql b/maintenance/archives/patch-filearchive.sql index 587a2ab4..f75da8be 100644 --- a/maintenance/archives/patch-filearchive.sql +++ b/maintenance/archives/patch-filearchive.sql @@ -4,30 +4,30 @@ CREATE TABLE /*$wgDBprefix*/filearchive ( -- Unique row id fa_id int not null auto_increment, - + -- Original base filename; key to image.img_name, page.page_title, etc fa_name varchar(255) binary NOT NULL default '', - + -- Filename of archived file, if an old revision fa_archive_name varchar(255) binary default '', - + -- Which storage bin (directory tree or object store) the file data -- is stored in. Should be 'deleted' for files that have been deleted; -- any other bin is not yet in use. fa_storage_group varbinary(16), - + -- SHA-1 of the file contents plus extension, used as a key for storage. -- eg 8f8a562add37052a1848ff7771a2c515db94baa9.jpg -- -- If NULL, the file was missing at deletion time or has been purged -- from the archival storage. fa_storage_key varbinary(64) default '', - + -- Deletion information, if this file is deleted. fa_deleted_user int, fa_deleted_timestamp binary(14) default '', fa_deleted_reason text, - + -- Duped fields from image fa_size int unsigned default '0', fa_width int default '0', @@ -41,7 +41,7 @@ CREATE TABLE /*$wgDBprefix*/filearchive ( fa_user int unsigned default '0', fa_user_text varchar(255) binary default '', fa_timestamp binary(14) default '', - + PRIMARY KEY (fa_id), INDEX (fa_name, fa_timestamp), -- pick out by image name INDEX (fa_storage_group, fa_storage_key), -- pick out dupe files diff --git a/maintenance/archives/patch-hitcounter.sql b/maintenance/archives/patch-hitcounter.sql index 50e56e0c..c87c9592 100644 --- a/maintenance/archives/patch-hitcounter.sql +++ b/maintenance/archives/patch-hitcounter.sql @@ -1,5 +1,5 @@ -- --- hitcounter table is used to buffer page hits before they are periodically +-- hitcounter table is used to buffer page hits before they are periodically -- counted and added to the cur_counter column in the cur table. -- December 2003 -- diff --git a/maintenance/archives/patch-image-user-index.sql b/maintenance/archives/patch-image-user-index.sql index db56b221..a74d7bd5 100644 --- a/maintenance/archives/patch-image-user-index.sql +++ b/maintenance/archives/patch-image-user-index.sql @@ -1,8 +1,8 @@ --- +-- -- image-user-index.sql --- +-- -- Add user/timestamp index to current image versions --- +-- ALTER TABLE /*$wgDBprefix*/image ADD INDEX img_usertext_timestamp (img_user_text,img_timestamp); diff --git a/maintenance/archives/patch-img_media_mime-index.sql b/maintenance/archives/patch-img_media_mime-index.sql new file mode 100644 index 00000000..bfaf84f9 --- /dev/null +++ b/maintenance/archives/patch-img_media_mime-index.sql @@ -0,0 +1,4 @@ +-- New index on image table to allow searches for types i.e. video webm +-- Added 2013-01-08 + +CREATE INDEX /*i*/img_media_mime ON /*_*/image (img_media_type,img_major_mime,img_minor_mime); diff --git a/maintenance/archives/patch-img_media_type.sql b/maintenance/archives/patch-img_media_type.sql index 857eb98e..87b8c2f5 100644 --- a/maintenance/archives/patch-img_media_type.sql +++ b/maintenance/archives/patch-img_media_type.sql @@ -4,11 +4,11 @@ ALTER TABLE /*$wgDBprefix*/image ADD ( -- Media type as defined by the MEDIATYPE_xxx constants img_media_type ENUM("UNKNOWN", "BITMAP", "DRAWING", "AUDIO", "VIDEO", "MULTIMEDIA", "OFFICE", "TEXT", "EXECUTABLE", "ARCHIVE") default NULL, - + -- major part of a MIME media type as defined by IANA -- see http://www.iana.org/assignments/media-types/ img_major_mime ENUM("unknown", "application", "audio", "image", "text", "video", "message", "model", "multipart") NOT NULL default "unknown", - + -- minor part of a MIME media type as defined by IANA -- the minor parts are not required to adher to any standard -- but should be consistent throughout the database diff --git a/maintenance/archives/patch-img_sha1.sql b/maintenance/archives/patch-img_sha1.sql index 35950f58..0a375c4f 100644 --- a/maintenance/archives/patch-img_sha1.sql +++ b/maintenance/archives/patch-img_sha1.sql @@ -1,8 +1,8 @@ -- Add img_sha1, oi_sha1 and related indexes ALTER TABLE /*$wgDBprefix*/image ADD COLUMN img_sha1 varbinary(32) NOT NULL default '', - ADD INDEX img_sha1 (img_sha1); + ADD INDEX img_sha1 (img_sha1(10)); ALTER TABLE /*$wgDBprefix*/oldimage ADD COLUMN oi_sha1 varbinary(32) NOT NULL default '', - ADD INDEX oi_sha1 (oi_sha1); + ADD INDEX oi_sha1 (oi_sha1(10)); diff --git a/maintenance/archives/patch-indexes.sql b/maintenance/archives/patch-indexes.sql index c56838fd..c24d9953 100644 --- a/maintenance/archives/patch-indexes.sql +++ b/maintenance/archives/patch-indexes.sql @@ -1,8 +1,8 @@ --- +-- -- patch-indexes.sql --- +-- -- Fix up table indexes; new to stable release in November 2003 --- +-- ALTER TABLE IF EXISTS /*$wgDBprefix*/links DROP INDEX l_from, diff --git a/maintenance/archives/patch-interwiki.sql b/maintenance/archives/patch-interwiki.sql index 321765b9..57b79456 100644 --- a/maintenance/archives/patch-interwiki.sql +++ b/maintenance/archives/patch-interwiki.sql @@ -5,16 +5,16 @@ CREATE TABLE /*$wgDBprefix*/interwiki ( -- The interwiki prefix, (e.g. "Meatball", or the language prefix "de") iw_prefix varchar(32) NOT NULL, - + -- The URL of the wiki, with "$1" as a placeholder for an article name. -- Any spaces in the name will be transformed to underscores before -- insertion. iw_url blob NOT NULL, - + -- A boolean value indicating whether the wiki is in this project -- (used, for example, to detect redirect loops) iw_local BOOL NOT NULL, - + UNIQUE KEY iw_prefix (iw_prefix) ) /*$wgDBTableOptions*/; diff --git a/maintenance/archives/patch-ipb_anon_only.sql b/maintenance/archives/patch-ipb_anon_only.sql index fcd257c7..bb39c1d9 100644 --- a/maintenance/archives/patch-ipb_anon_only.sql +++ b/maintenance/archives/patch-ipb_anon_only.sql @@ -1,9 +1,9 @@ --- Add extra option fields to the ipblocks table, add some extra indexes, --- convert infinity values in ipb_expiry to something that sorts better, --- extend ipb_address and range fields, add a unique index for block conflict +-- Add extra option fields to the ipblocks table, add some extra indexes, +-- convert infinity values in ipb_expiry to something that sorts better, +-- extend ipb_address and range fields, add a unique index for block conflict -- detection. --- Conflicts in the new unique index can be handled by creating a new +-- Conflicts in the new unique index can be handled by creating a new -- table and inserting into it instead of doing an ALTER TABLE. @@ -22,7 +22,7 @@ CREATE TABLE /*$wgDBprefix*/ipblocks_newunique ( ipb_expiry varbinary(14) NOT NULL default '', ipb_range_start tinyblob NOT NULL, ipb_range_end tinyblob NOT NULL, - + PRIMARY KEY ipb_id (ipb_id), UNIQUE INDEX ipb_address_unique (ipb_address(255), ipb_user, ipb_auto), INDEX ipb_user (ipb_user), @@ -32,8 +32,8 @@ CREATE TABLE /*$wgDBprefix*/ipblocks_newunique ( ) /*$wgDBTableOptions*/; -INSERT IGNORE INTO /*$wgDBprefix*/ipblocks_newunique - (ipb_id, ipb_address, ipb_user, ipb_by, ipb_reason, ipb_timestamp, ipb_auto, ipb_expiry, ipb_range_start, ipb_range_end, ipb_anon_only, ipb_create_account) +INSERT IGNORE INTO /*$wgDBprefix*/ipblocks_newunique + (ipb_id, ipb_address, ipb_user, ipb_by, ipb_reason, ipb_timestamp, ipb_auto, ipb_expiry, ipb_range_start, ipb_range_end, ipb_anon_only, ipb_create_account) SELECT ipb_id, ipb_address, ipb_user, ipb_by, ipb_reason, ipb_timestamp, ipb_auto, ipb_expiry, ipb_range_start, ipb_range_end, 0 , ipb_user=0 FROM /*$wgDBprefix*/ipblocks; diff --git a/maintenance/archives/patch-ipb_by_text.sql b/maintenance/archives/patch-ipb_by_text.sql index c0b620d3..e809d102 100644 --- a/maintenance/archives/patch-ipb_by_text.sql +++ b/maintenance/archives/patch-ipb_by_text.sql @@ -4,7 +4,7 @@ ALTER TABLE /*$wgDBprefix*/ipblocks ADD ipb_by_text varchar(255) binary NOT NULL default ''; -UPDATE /*$wgDBprefix*/ipblocks +UPDATE /*$wgDBprefix*/ipblocks JOIN /*$wgDBprefix*/user ON ipb_by = user_id SET ipb_by_text = user_name WHERE ipb_by != 0;
\ No newline at end of file diff --git a/maintenance/archives/patch-ipb_deleted.sql b/maintenance/archives/patch-ipb_deleted.sql index fad94778..b12ddaaa 100644 --- a/maintenance/archives/patch-ipb_deleted.sql +++ b/maintenance/archives/patch-ipb_deleted.sql @@ -1,3 +1,3 @@ -- Adding ipb_deleted field for hiding usernames -ALTER TABLE /*$wgDBprefix*/ipblocks +ALTER TABLE /*$wgDBprefix*/ipblocks ADD ipb_deleted bool NOT NULL default 0; diff --git a/maintenance/archives/patch-ipb_range_start.sql b/maintenance/archives/patch-ipb_range_start.sql index 64a906d4..84cba8f6 100644 --- a/maintenance/archives/patch-ipb_range_start.sql +++ b/maintenance/archives/patch-ipb_range_start.sql @@ -1,5 +1,5 @@ -- Add the range handling fields -ALTER TABLE /*$wgDBprefix*/ipblocks +ALTER TABLE /*$wgDBprefix*/ipblocks ADD ipb_range_start tinyblob NOT NULL default '', ADD ipb_range_end tinyblob NOT NULL default '', ADD INDEX ipb_range (ipb_range_start(8), ipb_range_end(8)); @@ -7,15 +7,15 @@ ALTER TABLE /*$wgDBprefix*/ipblocks -- Initialise fields -- Only range blocks match ipb_address LIKE '%/%', this fact is used in the code already -UPDATE /*$wgDBprefix*/ipblocks - SET - ipb_range_start = LPAD(HEX( +UPDATE /*$wgDBprefix*/ipblocks + SET + ipb_range_start = LPAD(HEX( (SUBSTRING_INDEX(ipb_address, '.', 1) << 24) + (SUBSTRING_INDEX(SUBSTRING_INDEX(ipb_address, '.', 2), '.', -1) << 16) + (SUBSTRING_INDEX(SUBSTRING_INDEX(ipb_address, '.', 3), '.', -1) << 24) + (SUBSTRING_INDEX(SUBSTRING_INDEX(ipb_address, '/', 1), '.', -1)) ), 8, '0' ), - ipb_range_end = LPAD(HEX( + ipb_range_end = LPAD(HEX( (SUBSTRING_INDEX(ipb_address, '.', 1) << 24) + (SUBSTRING_INDEX(SUBSTRING_INDEX(ipb_address, '.', 2), '.', -1) << 16) + (SUBSTRING_INDEX(SUBSTRING_INDEX(ipb_address, '.', 3), '.', -1) << 24) diff --git a/maintenance/archives/patch-iwlinks.sql b/maintenance/archives/patch-iwlinks.sql index 89b34cb1..b7bd3f13 100644 --- a/maintenance/archives/patch-iwlinks.sql +++ b/maintenance/archives/patch-iwlinks.sql @@ -1,10 +1,10 @@ --- +-- -- Track inline interwiki links -- CREATE TABLE /*_*/iwlinks ( -- page_id of the referring page iwl_from int unsigned NOT NULL default 0, - + -- Interwiki prefix code of the target iwl_prefix varbinary(20) NOT NULL default '', diff --git a/maintenance/archives/patch-job.sql b/maintenance/archives/patch-job.sql index c9199efb..662f5d27 100644 --- a/maintenance/archives/patch-job.sql +++ b/maintenance/archives/patch-job.sql @@ -1,7 +1,7 @@ -- Jobs performed by parallel apache threads or a command-line daemon CREATE TABLE /*_*/job ( job_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT, - + -- Command name -- Limited to 60 to prevent key length overflow job_cmd varbinary(60) NOT NULL default '', diff --git a/maintenance/archives/patch-job_attempts.sql b/maintenance/archives/patch-job_attempts.sql new file mode 100644 index 00000000..47b73e81 --- /dev/null +++ b/maintenance/archives/patch-job_attempts.sql @@ -0,0 +1,4 @@ +ALTER TABLE /*_*/job + ADD COLUMN job_attempts integer unsigned NOT NULL default 0; + +CREATE INDEX /*i*/job_cmd_token_id ON /*_*/job (job_cmd,job_token,job_id); diff --git a/maintenance/archives/patch-job_token.sql b/maintenance/archives/patch-job_token.sql new file mode 100644 index 00000000..080fa97c --- /dev/null +++ b/maintenance/archives/patch-job_token.sql @@ -0,0 +1,9 @@ +ALTER TABLE /*_*/job + ADD COLUMN job_random integer unsigned NOT NULL default 0, + ADD COLUMN job_token varbinary(32) NOT NULL default '', + ADD COLUMN job_token_timestamp varbinary(14) NULL default NULL, + ADD COLUMN job_sha1 varbinary(32) NOT NULL default ''; + +CREATE INDEX /*i*/job_sha1 ON /*_*/job (job_sha1); +CREATE INDEX /*i*/job_cmd_token ON /*_*/job (job_cmd,job_token,job_random); + diff --git a/maintenance/archives/patch-langlinks.sql b/maintenance/archives/patch-langlinks.sql index ffff07c0..5594acd5 100644 --- a/maintenance/archives/patch-langlinks.sql +++ b/maintenance/archives/patch-langlinks.sql @@ -1,7 +1,7 @@ CREATE TABLE /*$wgDBprefix*/langlinks ( -- page_id of the referring page ll_from int unsigned NOT NULL default '0', - + -- Language code of the target ll_lang varbinary(20) NOT NULL default '', diff --git a/maintenance/archives/patch-linktables.sql b/maintenance/archives/patch-linktables.sql index b15878c3..d53d2ea3 100644 --- a/maintenance/archives/patch-linktables.sql +++ b/maintenance/archives/patch-linktables.sql @@ -6,13 +6,13 @@ DROP TABLE IF EXISTS /*$wgDBprefix*/links; CREATE TABLE /*$wgDBprefix*/links ( -- Key to the page_id of the page containing the link. l_from int unsigned NOT NULL default '0', - + -- Key to the page_id of the link target. -- An unfortunate consequence of this is that rename -- operations require changing the links entries for -- all links to the moved page. l_to int unsigned NOT NULL default '0', - + UNIQUE KEY l_from(l_from,l_to), KEY (l_to) @@ -27,7 +27,7 @@ DROP TABLE IF EXISTS /*$wgDBprefix*/brokenlinks; CREATE TABLE /*$wgDBprefix*/brokenlinks ( -- Key to the page_id of the page containing the link. bl_from int unsigned NOT NULL default '0', - + -- Text of the target page title ("namesapce:title"). -- Unfortunately this doesn't split the namespace index -- key and therefore can't easily be joined to anything. @@ -46,12 +46,12 @@ DROP TABLE IF EXISTS /*$wgDBprefix*/imagelinks; CREATE TABLE /*$wgDBprefix*/imagelinks ( -- Key to page_id of the page containing the image / media link. il_from int unsigned NOT NULL default '0', - + -- Filename of target image. -- This is also the page_title of the file's description page; -- all such pages are in namespace 6 (NS_FILE). il_to varchar(255) binary NOT NULL default '', - + UNIQUE KEY il_from(il_from,il_to), KEY (il_to) diff --git a/maintenance/archives/patch-log_search-rename-index.sql b/maintenance/archives/patch-log_search-rename-index.sql index 41e051d8..7e1113e6 100644 --- a/maintenance/archives/patch-log_search-rename-index.sql +++ b/maintenance/archives/patch-log_search-rename-index.sql @@ -1,7 +1,7 @@ -- Rename the primary unique index from PRIMARY to ls_field_val -- This is for MySQL only and is necessary only for databases which were updated -- between MW 1.16 development revisions r50567 and r51465. -ALTER TABLE /*_*/log_search - DROP PRIMARY KEY, +ALTER TABLE /*_*/log_search + DROP PRIMARY KEY, ADD UNIQUE INDEX ls_field_val (ls_field,ls_value,ls_log_id); diff --git a/maintenance/archives/patch-log_user_text.sql b/maintenance/archives/patch-log_user_text.sql index 9a783d87..12ca75e5 100644 --- a/maintenance/archives/patch-log_user_text.sql +++ b/maintenance/archives/patch-log_user_text.sql @@ -1,4 +1,4 @@ -ALTER TABLE /*$wgDBprefix*/logging +ALTER TABLE /*$wgDBprefix*/logging ADD log_user_text varchar(255) binary NOT NULL default '', ADD log_page int unsigned NULL, CHANGE log_type log_type varbinary(32) NOT NULL, diff --git a/maintenance/archives/patch-logging-times-index.sql b/maintenance/archives/patch-logging-times-index.sql index e66ceec4..5f24f5c3 100644 --- a/maintenance/archives/patch-logging-times-index.sql +++ b/maintenance/archives/patch-logging-times-index.sql @@ -1,8 +1,8 @@ --- +-- -- patch-logging-times-index.sql --- +-- -- Add a very humble index on logging times --- +-- ALTER TABLE /*$wgDBprefix*/logging ADD INDEX times (log_timestamp); diff --git a/maintenance/archives/patch-logging.sql b/maintenance/archives/patch-logging.sql index b5cfdf72..79df0dd4 100644 --- a/maintenance/archives/patch-logging.sql +++ b/maintenance/archives/patch-logging.sql @@ -7,21 +7,21 @@ CREATE TABLE /*$wgDBprefix*/logging ( -- action field, but only the type controls categorization. log_type varbinary(10) NOT NULL default '', log_action varbinary(10) NOT NULL default '', - + -- Timestamp. Duh. log_timestamp binary(14) NOT NULL default '19700101000000', - + -- The user who performed this action; key to user_id log_user int unsigned NOT NULL default 0, - + -- Key to the page affected. Where a user is the target, -- this will point to the user page. log_namespace int NOT NULL default 0, log_title varchar(255) binary NOT NULL default '', - + -- Freeform text. Interpreted as edit history comments. log_comment varchar(255) NOT NULL default '', - + -- LF separated list of miscellaneous parameters log_params blob NOT NULL, diff --git a/maintenance/archives/patch-mime_minor_length.sql b/maintenance/archives/patch-mime_minor_length.sql index 8b63d1f0..88dd64cf 100644 --- a/maintenance/archives/patch-mime_minor_length.sql +++ b/maintenance/archives/patch-mime_minor_length.sql @@ -3,8 +3,8 @@ ALTER TABLE /*_*/filearchive ALTER TABLE /*_*/image MODIFY COLUMN img_minor_mime varbinary(100) NOT NULL default "unknown"; - + ALTER TABLE /*_*/oldimage MODIFY COLUMN oi_minor_mime varbinary(100) NOT NULL default "unknown"; - + INSERT INTO /*_*/updatelog(ul_key) VALUES ('mime_minor_length'); diff --git a/maintenance/archives/patch-msg_resource.sql b/maintenance/archives/patch-msg_resource.sql index f4f35339..9fa05d2a 100644 --- a/maintenance/archives/patch-msg_resource.sql +++ b/maintenance/archives/patch-msg_resource.sql @@ -2,7 +2,7 @@ CREATE TABLE /*_*/msg_resource ( -- Resource name mr_resource varbinary(255) NOT NULL, - -- Language code + -- Language code mr_lang varbinary(32) NOT NULL, -- JSON blob. This is an incomplete JSON object, i.e. without the wrapping {} mr_blob mediumblob NOT NULL, diff --git a/maintenance/archives/patch-oi_metadata.sql b/maintenance/archives/patch-oi_metadata.sql index bc848878..df043c55 100644 --- a/maintenance/archives/patch-oi_metadata.sql +++ b/maintenance/archives/patch-oi_metadata.sql @@ -1,10 +1,10 @@ --- +-- -- patch-oi_metadata.sql --- +-- -- Add data to allow for direct reference to old images -- Some re-indexing here. -- Old images can be included into pages effeciently now. --- +-- ALTER TABLE /*$wgDBprefix*/oldimage DROP INDEX oi_name, diff --git a/maintenance/archives/patch-oldimage-user-index.sql b/maintenance/archives/patch-oldimage-user-index.sql index 949625eb..2c7f8071 100644 --- a/maintenance/archives/patch-oldimage-user-index.sql +++ b/maintenance/archives/patch-oldimage-user-index.sql @@ -1,8 +1,8 @@ --- +-- -- oldimage-user-index.sql --- +-- -- Add user/timestamp index to old image versions --- +-- ALTER TABLE /*$wgDBprefix*/oldimage ADD INDEX oi_usertext_timestamp (oi_user_text,oi_timestamp); diff --git a/maintenance/archives/patch-page-page_content_model.sql b/maintenance/archives/patch-page-page_content_model.sql new file mode 100644 index 00000000..30434d93 --- /dev/null +++ b/maintenance/archives/patch-page-page_content_model.sql @@ -0,0 +1,2 @@ +ALTER TABLE /*$wgDBprefix*/page + ADD page_content_model varbinary(32) DEFAULT NULL; diff --git a/maintenance/archives/patch-page_props-propname-page-index.sql b/maintenance/archives/patch-page_props-propname-page-index.sql new file mode 100644 index 00000000..822fa04d --- /dev/null +++ b/maintenance/archives/patch-page_props-propname-page-index.sql @@ -0,0 +1,4 @@ +-- +-- Creates the pp_propname_page index on page_props +-- +CREATE UNIQUE INDEX /*i*/pp_propname_page ON /*_*/page_props (pp_propname, pp_page); diff --git a/maintenance/archives/patch-pagelinks.sql b/maintenance/archives/patch-pagelinks.sql index 118592fb..cea89b52 100644 --- a/maintenance/archives/patch-pagelinks.sql +++ b/maintenance/archives/patch-pagelinks.sql @@ -1,7 +1,7 @@ -- -- Create the new pagelinks table to merge links and brokenlinks data, -- and populate it. --- +-- -- Unlike the old links and brokenlinks, these records will not need to be -- altered when target pages are created, deleted, or renamed. This should -- reduce the amount of severe database frustration that happens when widely- @@ -19,14 +19,14 @@ CREATE TABLE /*$wgDBprefix*/pagelinks ( -- Key to the page_id of the page containing the link. pl_from int unsigned NOT NULL default '0', - + -- Key to page_namespace/page_title of the target page. -- The target page may or may not exist, and due to renames -- and deletions may refer to different page records as time -- goes by. pl_namespace int NOT NULL default '0', pl_title varchar(255) binary NOT NULL default '', - + UNIQUE KEY pl_from(pl_from,pl_namespace,pl_title), KEY (pl_namespace,pl_title) diff --git a/maintenance/archives/patch-parsercache.sql b/maintenance/archives/patch-parsercache.sql index 395a81bd..5fe241c3 100644 --- a/maintenance/archives/patch-parsercache.sql +++ b/maintenance/archives/patch-parsercache.sql @@ -1,5 +1,5 @@ -- --- parsercache table, for cacheing complete parsed articles +-- parsercache table, for cacheing complete parsed articles -- before they are imbedded in the skin. -- diff --git a/maintenance/archives/patch-pl-tl-il-unique.sql b/maintenance/archives/patch-pl-tl-il-unique.sql index 186a2036..a3566705 100644 --- a/maintenance/archives/patch-pl-tl-il-unique.sql +++ b/maintenance/archives/patch-pl-tl-il-unique.sql @@ -1,6 +1,6 @@ --- +-- -- patch-pl-tl-il-unique-index.sql --- +-- -- Make reorderings of UNIQUE indices UNIQUE as well DROP INDEX /*i*/pl_namespace ON /*_*/pagelinks; diff --git a/maintenance/archives/patch-querycache.sql b/maintenance/archives/patch-querycache.sql index e6da79cc..8e1a5188 100644 --- a/maintenance/archives/patch-querycache.sql +++ b/maintenance/archives/patch-querycache.sql @@ -3,14 +3,14 @@ CREATE TABLE /*$wgDBprefix*/querycache ( -- A key name, generally the base name of of the special page. qc_type varbinary(32) NOT NULL, - + -- Some sort of stored value. Sizes, counts... qc_value int unsigned NOT NULL default '0', - + -- Target namespace+title qc_namespace int NOT NULL default '0', qc_title varchar(255) binary NOT NULL default '', - + KEY (qc_type,qc_value) ) /*$wgDBTableOptions*/; diff --git a/maintenance/archives/patch-querycachetwo.sql b/maintenance/archives/patch-querycachetwo.sql index 01623bc7..79131310 100644 --- a/maintenance/archives/patch-querycachetwo.sql +++ b/maintenance/archives/patch-querycachetwo.sql @@ -3,14 +3,14 @@ CREATE TABLE /*$wgDBprefix*/querycachetwo ( -- A key name, generally the base name of of the special page. qcc_type varbinary(32) NOT NULL, - + -- Some sort of stored value. Sizes, counts... qcc_value int unsigned NOT NULL default '0', - + -- Target namespace+title qcc_namespace int NOT NULL default '0', qcc_title varchar(255) binary NOT NULL default '', - + -- Target namespace+title2 qcc_namespacetwo int NOT NULL default '0', qcc_titletwo varchar(255) binary NOT NULL default '', diff --git a/maintenance/archives/patch-rc_deleted.sql b/maintenance/archives/patch-rc_deleted.sql index 04ead974..f4bbd0f9 100644 --- a/maintenance/archives/patch-rc_deleted.sql +++ b/maintenance/archives/patch-rc_deleted.sql @@ -1,6 +1,6 @@ -- Adding rc_deleted field for revisiondelete -- Add rc_logid to match log_id -ALTER TABLE /*$wgDBprefix*/recentchanges +ALTER TABLE /*$wgDBprefix*/recentchanges ADD rc_deleted tinyint unsigned NOT NULL default '0', ADD rc_logid int unsigned NOT NULL default '0', ADD rc_log_type varbinary(255) NULL default NULL, diff --git a/maintenance/archives/patch-rc_id.sql b/maintenance/archives/patch-rc_id.sql index 3b023753..28caee0e 100644 --- a/maintenance/archives/patch-rc_id.sql +++ b/maintenance/archives/patch-rc_id.sql @@ -1,6 +1,6 @@ -- Primary key in recentchanges -ALTER TABLE /*$wgDBprefix*/recentchanges +ALTER TABLE /*$wgDBprefix*/recentchanges ADD rc_id int NOT NULL auto_increment, ADD PRIMARY KEY rc_id (rc_id); diff --git a/maintenance/archives/patch-rc_ip.sql b/maintenance/archives/patch-rc_ip.sql index 6b0b0534..4d93300f 100644 --- a/maintenance/archives/patch-rc_ip.sql +++ b/maintenance/archives/patch-rc_ip.sql @@ -1,6 +1,6 @@ -- Adding the rc_ip field for logging of IP addresses in recentchanges -ALTER TABLE /*$wgDBprefix*/recentchanges +ALTER TABLE /*$wgDBprefix*/recentchanges ADD rc_ip varbinary(40) NOT NULL default '', ADD INDEX rc_ip (rc_ip); diff --git a/maintenance/archives/patch-rc_moved.sql b/maintenance/archives/patch-rc_moved.sql new file mode 100644 index 00000000..2fa1de6b --- /dev/null +++ b/maintenance/archives/patch-rc_moved.sql @@ -0,0 +1,4 @@ +-- rc_moved_to_ns and rc_moved_to_title is no longer used, delete the fields + +ALTER TABLE /*$wgDBprefix*/recentchanges DROP COLUMN rc_moved_to_ns, + DROP COLUMN rc_moved_to_title; diff --git a/maintenance/archives/patch-redirect.sql b/maintenance/archives/patch-redirect.sql index 5d7218bc..d2957df4 100644 --- a/maintenance/archives/patch-redirect.sql +++ b/maintenance/archives/patch-redirect.sql @@ -1,7 +1,7 @@ -- -- Create the new redirect table. -- For each redirect, this table contains exactly one row defining its target --- +-- CREATE TABLE /*$wgDBprefix*/redirect ( -- Key to the page_id of the redirect page rd_from int unsigned NOT NULL default '0', diff --git a/maintenance/archives/patch-rename-iwl_prefix.sql b/maintenance/archives/patch-rename-iwl_prefix.sql index 4b11b36b..4a410037 100644 --- a/maintenance/archives/patch-rename-iwl_prefix.sql +++ b/maintenance/archives/patch-rename-iwl_prefix.sql @@ -1,4 +1,4 @@ --- +-- -- Recreates the iwl_prefix index for the iwlinks table -- CREATE UNIQUE INDEX /*i*/iwl_prefix_title_from ON /*_*/iwlinks (iwl_prefix, iwl_title, iwl_from); diff --git a/maintenance/archives/patch-restructure.sql b/maintenance/archives/patch-restructure.sql index 7b638483..a5bc3e52 100644 --- a/maintenance/archives/patch-restructure.sql +++ b/maintenance/archives/patch-restructure.sql @@ -38,7 +38,6 @@ CREATE TABLE /*$wgDBprefix*/revision ( rev_minor_edit tinyint unsigned NOT NULL default '0', rev_deleted tinyint unsigned NOT NULL default '0', - PRIMARY KEY rev_page_id (rev_page, rev_id), UNIQUE INDEX rev_id (rev_id), INDEX rev_timestamp (rev_timestamp), @@ -53,7 +52,7 @@ CREATE TABLE /*$wgDBprefix*/revision ( -- old_id int(8) unsigned NOT NULL auto_increment, -- old_text mediumtext NOT NULL, -- old_flags tinyblob NOT NULL, --- +-- -- PRIMARY KEY old_id (old_id) -- ); diff --git a/maintenance/archives/patch-revision-rev_content_format.sql b/maintenance/archives/patch-revision-rev_content_format.sql new file mode 100644 index 00000000..22aeb8a7 --- /dev/null +++ b/maintenance/archives/patch-revision-rev_content_format.sql @@ -0,0 +1,2 @@ +ALTER TABLE /*$wgDBprefix*/revision + ADD rev_content_format varbinary(64) DEFAULT NULL; diff --git a/maintenance/archives/patch-revision-rev_content_model.sql b/maintenance/archives/patch-revision-rev_content_model.sql new file mode 100644 index 00000000..1ba05721 --- /dev/null +++ b/maintenance/archives/patch-revision-rev_content_model.sql @@ -0,0 +1,2 @@ +ALTER TABLE /*$wgDBprefix*/revision + ADD rev_content_model varbinary(32) DEFAULT NULL; diff --git a/maintenance/archives/patch-searchindex.sql b/maintenance/archives/patch-searchindex.sql index 9b635a8f..36507a2b 100644 --- a/maintenance/archives/patch-searchindex.sql +++ b/maintenance/archives/patch-searchindex.sql @@ -10,13 +10,13 @@ DROP TABLE IF EXISTS /*$wgDBprefix*/searchindex; CREATE TABLE /*$wgDBprefix*/searchindex ( -- Key to page_id si_page int unsigned NOT NULL, - + -- Munged version of title si_title varchar(255) NOT NULL default '', - + -- Munged version of body text si_text mediumtext NOT NULL, - + UNIQUE KEY (si_page) ) ENGINE=MyISAM; diff --git a/maintenance/archives/patch-sites.sql b/maintenance/archives/patch-sites.sql new file mode 100644 index 00000000..88392748 --- /dev/null +++ b/maintenance/archives/patch-sites.sql @@ -0,0 +1,71 @@ +-- Patch to add the sites and site_identifiers tables. +-- Licence: GNU GPL v2+ +-- Author: Jeroen De Dauw < jeroendedauw@gmail.com > + + +-- Holds all the sites known to the wiki. +CREATE TABLE IF NOT EXISTS /*_*/sites ( +-- Numeric id of the site + site_id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, + + -- Global identifier for the site, ie 'enwiktionary' + site_global_key varbinary(32) NOT NULL, + + -- Type of the site, ie 'mediawiki' + site_type varbinary(32) NOT NULL, + + -- Group of the site, ie 'wikipedia' + site_group varbinary(32) NOT NULL, + + -- Source of the site data, ie 'local', 'wikidata', 'my-magical-repo' + site_source varbinary(32) NOT NULL, + + -- Language code of the sites primary language. + site_language varbinary(32) NOT NULL, + + -- Protocol of the site, ie 'http://', 'irc://', '//' + -- This field is an index for lookups and is build from type specific data in site_data. + site_protocol varbinary(32) NOT NULL, + + -- Domain of the site in reverse order, ie 'org.mediawiki.www.' + -- This field is an index for lookups and is build from type specific data in site_data. + site_domain VARCHAR(255) NOT NULL, + + -- Type dependent site data. + site_data BLOB NOT NULL, + + -- If site.tld/path/key:pageTitle should forward users to the page on + -- the actual site, where "key" is the local identifier. + site_forward bool NOT NULL, + + -- Type dependent site config. + -- For instance if template transclusion should be allowed if it's a MediaWiki. + site_config BLOB NOT NULL +) /*$wgDBTableOptions*/; + +CREATE UNIQUE INDEX /*i*/sites_global_key ON /*_*/sites (site_global_key); +CREATE INDEX /*i*/sites_type ON /*_*/sites (site_type); +CREATE INDEX /*i*/sites_group ON /*_*/sites (site_group); +CREATE INDEX /*i*/sites_source ON /*_*/sites (site_source); +CREATE INDEX /*i*/sites_language ON /*_*/sites (site_language); +CREATE INDEX /*i*/sites_protocol ON /*_*/sites (site_protocol); +CREATE INDEX /*i*/sites_domain ON /*_*/sites (site_domain); +CREATE INDEX /*i*/sites_forward ON /*_*/sites (site_forward); + + + +-- Links local site identifiers to their corresponding site. +CREATE TABLE IF NOT EXISTS /*_*/site_identifiers ( + -- Key on site.site_id + si_site INT UNSIGNED NOT NULL, + + -- local key type, ie 'interwiki' or 'langlink' + si_type varbinary(32) NOT NULL, + + -- local key value, ie 'en' or 'wiktionary' + si_key varbinary(32) NOT NULL +) /*$wgDBTableOptions*/; + +CREATE UNIQUE INDEX /*i*/site_ids_type ON /*_*/site_identifiers (si_type, si_key); +CREATE INDEX /*i*/site_ids_site ON /*_*/site_identifiers (si_site); +CREATE INDEX /*i*/site_ids_key ON /*_*/site_identifiers (si_key);
\ No newline at end of file diff --git a/maintenance/archives/patch-templatelinks.sql b/maintenance/archives/patch-templatelinks.sql index a545b34e..086b6a1b 100644 --- a/maintenance/archives/patch-templatelinks.sql +++ b/maintenance/archives/patch-templatelinks.sql @@ -4,16 +4,15 @@ CREATE TABLE /*$wgDBprefix*/templatelinks ( -- Key to the page_id of the page containing the link. tl_from int unsigned NOT NULL default '0', - + -- Key to page_namespace/page_title of the target page. -- The target page may or may not exist, and due to renames -- and deletions may refer to different page records as time -- goes by. tl_namespace int NOT NULL default '0', tl_title varchar(255) binary NOT NULL default '', - + UNIQUE KEY tl_from(tl_from,tl_namespace,tl_title), KEY (tl_namespace,tl_title) - ) /*$wgDBTableOptions*/; diff --git a/maintenance/archives/patch-testrun.sql b/maintenance/archives/patch-testrun.sql index 8591d81d..6699b554 100644 --- a/maintenance/archives/patch-testrun.sql +++ b/maintenance/archives/patch-testrun.sql @@ -12,13 +12,13 @@ drop table if exists /*$wgDBprefix*/testrun; create table /*$wgDBprefix*/testrun ( tr_id int not null auto_increment, - + tr_date char(14) binary, tr_mw_version blob, tr_php_version blob, tr_db_version blob, tr_uname blob, - + primary key (tr_id) ) engine=InnoDB; @@ -26,10 +26,10 @@ create table /*$wgDBprefix*/testitem ( ti_run int not null, ti_name varchar(255), ti_success bool, - + unique key (ti_run, ti_name), key (ti_run, ti_success), - + foreign key (ti_run) references /*$wgDBprefix*/testrun(tr_id) on delete cascade ) engine=InnoDB; diff --git a/maintenance/archives/patch-ufg_group-length-increase-255.sql b/maintenance/archives/patch-ufg_group-length-increase-255.sql new file mode 100644 index 00000000..4b7f0d38 --- /dev/null +++ b/maintenance/archives/patch-ufg_group-length-increase-255.sql @@ -0,0 +1,2 @@ +ALTER TABLE /*_*/user_former_groups + MODIFY COLUMN ufg_group varbinary(255) NOT NULL default ''; diff --git a/maintenance/archives/patch-ufg_group-length-increase.sql b/maintenance/archives/patch-ufg_group-length-increase.sql deleted file mode 100644 index e24cba02..00000000 --- a/maintenance/archives/patch-ufg_group-length-increase.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE /*_*/user_former_groups - MODIFY COLUMN ufg_group varbinary(32) NOT NULL default ''; diff --git a/maintenance/archives/patch-ug_group-length-increase-255.sql b/maintenance/archives/patch-ug_group-length-increase-255.sql new file mode 100644 index 00000000..79e17ac0 --- /dev/null +++ b/maintenance/archives/patch-ug_group-length-increase-255.sql @@ -0,0 +1,2 @@ +ALTER TABLE /*_*/user_groups + MODIFY COLUMN ug_group varbinary(255) NOT NULL default ''; diff --git a/maintenance/archives/patch-ug_group-length-increase.sql b/maintenance/archives/patch-ug_group-length-increase.sql deleted file mode 100644 index e944a858..00000000 --- a/maintenance/archives/patch-ug_group-length-increase.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE /*_*/user_groups - MODIFY COLUMN ug_group varbinary(32) NOT NULL default ''; diff --git a/maintenance/archives/patch-uploadstash-us_props.sql b/maintenance/archives/patch-uploadstash-us_props.sql new file mode 100644 index 00000000..d64515a8 --- /dev/null +++ b/maintenance/archives/patch-uploadstash-us_props.sql @@ -0,0 +1,2 @@ +ALTER TABLE /*$wgDBprefix*/uploadstash + ADD COLUMN us_props blob; diff --git a/maintenance/archives/patch-uploadstash.sql b/maintenance/archives/patch-uploadstash.sql index 2512076f..14eaeab0 100644 --- a/maintenance/archives/patch-uploadstash.sql +++ b/maintenance/archives/patch-uploadstash.sql @@ -1,10 +1,10 @@ -- --- Store information about newly uploaded files before they're +-- Store information about newly uploaded files before they're -- moved into the actual filestore -- CREATE TABLE /*_*/uploadstash ( us_id int unsigned NOT NULL PRIMARY KEY auto_increment, - + -- the user who uploaded the file. us_user int unsigned NOT NULL, @@ -14,16 +14,16 @@ CREATE TABLE /*_*/uploadstash ( -- the original path us_orig_path varchar(255) NOT NULL, - + -- the temporary path at which the file is actually stored us_path varchar(255) NOT NULL, - + -- which type of upload the file came from (sometimes) us_source_type varchar(50), - + -- the date/time on which the file was added us_timestamp varbinary(14) not null, - + us_status varchar(50) not null, -- file properties from File::getPropsFromPath. these may prove unnecessary. @@ -33,12 +33,11 @@ CREATE TABLE /*_*/uploadstash ( us_sha1 varchar(31) NOT NULL, us_mime varchar(255), -- Media type as defined by the MEDIATYPE_xxx constants, should duplicate definition in the image table - us_media_type ENUM("UNKNOWN", "BITMAP", "DRAWING", "AUDIO", "VIDEO", "MULTIMEDIA", "OFFICE", "TEXT", "EXECUTABLE", "ARCHIVE") default NULL, + us_media_type ENUM("UNKNOWN", "BITMAP", "DRAWING", "AUDIO", "VIDEO", "MULTIMEDIA", "OFFICE", "TEXT", "EXECUTABLE", "ARCHIVE") default NULL, -- image-specific properties us_image_width int unsigned, us_image_height int unsigned, us_image_bits smallint unsigned - ) /*$wgDBTableOptions*/; -- sometimes there's a delete for all of a user's stuff. diff --git a/maintenance/archives/patch-user-realname.sql b/maintenance/archives/patch-user-realname.sql index 96edaa43..de7cee75 100644 --- a/maintenance/archives/patch-user-realname.sql +++ b/maintenance/archives/patch-user-realname.sql @@ -1,5 +1,5 @@ -- Add a 'real name' field where users can specify the name they want -- used for author attribution or other places that real names matter. -ALTER TABLE user +ALTER TABLE user ADD (user_real_name varchar(255) binary NOT NULL default ''); diff --git a/maintenance/archives/patch-user_former_groups.sql b/maintenance/archives/patch-user_former_groups.sql index ef56db06..b043196d 100644 --- a/maintenance/archives/patch-user_former_groups.sql +++ b/maintenance/archives/patch-user_former_groups.sql @@ -1,9 +1,9 @@ --- Stores the groups the user has once belonged to. +-- Stores the groups the user has once belonged to. -- The user may still belong these groups. Check user_groups. CREATE TABLE /*_*/user_former_groups ( -- Key to user_id ufg_user int unsigned NOT NULL default 0, - ufg_group varbinary(32) NOT NULL default '' + ufg_group varbinary(255) NOT NULL default '' ) /*$wgDBTableOptions*/; CREATE UNIQUE INDEX /*i*/ufg_user_group ON /*_*/user_former_groups (ufg_user,ufg_group); diff --git a/maintenance/archives/patch-user_groups.sql b/maintenance/archives/patch-user_groups.sql index c3740332..1683cf2a 100644 --- a/maintenance/archives/patch-user_groups.sql +++ b/maintenance/archives/patch-user_groups.sql @@ -9,7 +9,7 @@ CREATE TABLE /*$wgDBprefix*/user_groups ( -- Key to user_id ug_user int unsigned NOT NULL default '0', - + -- Group names are short symbolic string keys. -- The set of group names is open-ended, though in practice -- only some predefined ones are likely to be used. @@ -19,7 +19,7 @@ CREATE TABLE /*$wgDBprefix*/user_groups ( -- permissions of any group they're explicitly in, plus -- the implicit '*' and 'user' groups. ug_group varbinary(16) NOT NULL default '', - + PRIMARY KEY (ug_user,ug_group), KEY (ug_group) ) /*$wgDBTableOptions*/; diff --git a/maintenance/archives/patch-user_properties.sql b/maintenance/archives/patch-user_properties.sql index e30e00dc..85b00616 100644 --- a/maintenance/archives/patch-user_properties.sql +++ b/maintenance/archives/patch-user_properties.sql @@ -10,10 +10,10 @@ CREATE TABLE /*_*/user_properties( -- Foreign key to user.user_id up_user int not null, - + -- Name of the option being saved. This is indexed for bulk lookup. up_property varbinary(32) not null, - + -- Property value as a string. up_value blob ) /*$wgDBTableOptions*/; diff --git a/maintenance/archives/patch-user_rights.sql b/maintenance/archives/patch-user_rights.sql index 9866654c..4947cb1f 100644 --- a/maintenance/archives/patch-user_rights.sql +++ b/maintenance/archives/patch-user_rights.sql @@ -8,10 +8,10 @@ CREATE TABLE /*$wgDBprefix*/user_rights ( -- Key to user_id ur_user int unsigned NOT NULL, - + -- Comma-separated list of permission keys ur_rights tinyblob NOT NULL, - + UNIQUE KEY ur_user (ur_user) ) /*$wgDBTableOptions*/; diff --git a/maintenance/archives/upgradeLogging.php b/maintenance/archives/upgradeLogging.php index 2c28011b..f0806458 100644 --- a/maintenance/archives/upgradeLogging.php +++ b/maintenance/archives/upgradeLogging.php @@ -34,9 +34,9 @@ class UpdateLogging { /** * @var DatabaseBase */ - var $dbw; - var $batchSize = 1000; - var $minTs = false; + public $dbw; + public $batchSize = 1000; + public $minTs = false; function execute() { $this->dbw = wfGetDB( DB_MASTER ); @@ -211,4 +211,3 @@ EOT; $ul = new UpdateLogging; $ul->execute(); - |