From e256c69f9ad2c6244bc117459733b0c31dcaa515 Mon Sep 17 00:00:00 2001 From: umherirrender Date: Sat, 20 Oct 2012 13:35:38 +0200 Subject: [PATCH] Remove a bunch of trailing spaces and unneeded newlines Change-Id: If9fb04f64389b9b40c13f3372ad4792c2e14def0 --- maintenance/archives/patch-archive-user-index.sql | 2 +- maintenance/archives/patch-backlinkindexes.sql | 8 ++++---- maintenance/archives/patch-category.sql | 2 +- maintenance/archives/patch-categorylinks.sql | 12 ++++++------ maintenance/archives/patch-categorylinksindex.sql | 6 +++--- maintenance/archives/patch-externallinks.sql | 2 +- maintenance/archives/patch-fa_deleted.sql | 2 +- .../archives/patch-filearchive-user-index.sql | 2 +- maintenance/archives/patch-filearchive.sql | 14 +++++++------- maintenance/archives/patch-hitcounter.sql | 2 +- maintenance/archives/patch-image-user-index.sql | 6 +++--- maintenance/archives/patch-img_media_type.sql | 4 ++-- maintenance/archives/patch-indexes.sql | 6 +++--- maintenance/archives/patch-interwiki.sql | 6 +++--- maintenance/archives/patch-ipb_anon_only.sql | 14 +++++++------- maintenance/archives/patch-ipb_by_text.sql | 2 +- maintenance/archives/patch-ipb_deleted.sql | 2 +- maintenance/archives/patch-ipb_range_start.sql | 10 +++++----- maintenance/archives/patch-iwlinks.sql | 4 ++-- maintenance/archives/patch-job.sql | 2 +- maintenance/archives/patch-langlinks.sql | 2 +- maintenance/archives/patch-linktables.sql | 10 +++++----- .../archives/patch-log_search-rename-index.sql | 4 ++-- maintenance/archives/patch-log_user_text.sql | 2 +- maintenance/archives/patch-logging-times-index.sql | 6 +++--- maintenance/archives/patch-logging.sql | 10 +++++----- maintenance/archives/patch-mime_minor_length.sql | 4 ++-- maintenance/archives/patch-msg_resource.sql | 2 +- maintenance/archives/patch-oi_metadata.sql | 6 +++--- maintenance/archives/patch-oldimage-user-index.sql | 6 +++--- maintenance/archives/patch-pagelinks.sql | 6 +++--- maintenance/archives/patch-parsercache.sql | 2 +- maintenance/archives/patch-pl-tl-il-unique.sql | 4 ++-- maintenance/archives/patch-querycache.sql | 6 +++--- maintenance/archives/patch-querycachetwo.sql | 6 +++--- maintenance/archives/patch-rc_deleted.sql | 2 +- maintenance/archives/patch-rc_id.sql | 2 +- maintenance/archives/patch-rc_ip.sql | 2 +- maintenance/archives/patch-redirect.sql | 2 +- maintenance/archives/patch-rename-iwl_prefix.sql | 2 +- maintenance/archives/patch-restructure.sql | 3 +-- maintenance/archives/patch-searchindex.sql | 6 +++--- maintenance/archives/patch-templatelinks.sql | 5 ++--- maintenance/archives/patch-testrun.sql | 8 ++++---- maintenance/archives/patch-uploadstash.sql | 13 ++++++------- maintenance/archives/patch-user-realname.sql | 2 +- maintenance/archives/patch-user_former_groups.sql | 2 +- maintenance/archives/patch-user_groups.sql | 4 ++-- maintenance/archives/patch-user_properties.sql | 4 ++-- maintenance/archives/patch-user_rights.sql | 4 ++-- 50 files changed, 121 insertions(+), 124 deletions(-) diff --git a/maintenance/archives/patch-archive-user-index.sql b/maintenance/archives/patch-archive-user-index.sql index 62baa2ddc2..997b4a9763 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 5facd9ea1b..22cc587119 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 416500c3cc..97a5690dc8 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 02168d7f25..0af0cf915c 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 8a9ff1239c..24ad84fe5f 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-externallinks.sql b/maintenance/archives/patch-externallinks.sql index 0a4768ca5e..fc5017db89 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 3483f8cf97..7ab6523938 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-filearchive-user-index.sql b/maintenance/archives/patch-filearchive-user-index.sql index c79000adaa..0d8c3ab15e 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 587a2ab4d2..f75da8bec3 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 50e56e0ce2..c87c9592e5 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 db56b221f8..a74d7bd5f3 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_type.sql b/maintenance/archives/patch-img_media_type.sql index 857eb98e7c..87b8c2f530 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-indexes.sql b/maintenance/archives/patch-indexes.sql index c56838fdd9..c24d99530d 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 321765b934..57b794566f 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 fcd257c742..bb39c1d9d6 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 c0b620d338..e809d102fa 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 fad9477821..b12ddaaa2d 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 64a906d459..84cba8f6a6 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 89b34cb1ab..b7bd3f13f3 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 c9199efbca..662f5d2740 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-langlinks.sql b/maintenance/archives/patch-langlinks.sql index ffff07c0ae..5594acd5bc 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 b15878c3a7..d53d2ea3ad 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 41e051d865..7e1113e6e2 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 9a783d8791..12ca75e536 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 e66ceec449..5f24f5c392 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 b5cfdf7299..79df0dd4c6 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 8b63d1f02a..88dd64cf79 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 f4f35339b9..9fa05d2a24 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 bc8488785e..df043c5536 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 949625eb15..2c7f8071c7 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-pagelinks.sql b/maintenance/archives/patch-pagelinks.sql index 118592fb2b..cea89b52fb 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 395a81bd68..5fe241c310 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 186a203669..a3566705c5 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 e6da79cc28..8e1a5188a0 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 01623bc717..79131310e3 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 04ead97480..f4bbd0f931 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 3b0237537f..28caee0eca 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 6b0b053438..4d93300f03 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-redirect.sql b/maintenance/archives/patch-redirect.sql index 5d7218bc08..d2957df41a 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 4b11b36b87..4a410037fb 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 7b638483b4..a5bc3e521a 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-searchindex.sql b/maintenance/archives/patch-searchindex.sql index 9b635a8fbd..36507a2be8 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-templatelinks.sql b/maintenance/archives/patch-templatelinks.sql index a545b34e94..086b6a1b7e 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 8591d81df4..6699b5546b 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-uploadstash.sql b/maintenance/archives/patch-uploadstash.sql index 2512076f49..556d6b2877 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. @@ -38,7 +38,6 @@ CREATE TABLE /*_*/uploadstash ( 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 96edaa4322..de7cee75b9 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 ef56db065e..591c753bec 100644 --- a/maintenance/archives/patch-user_former_groups.sql +++ b/maintenance/archives/patch-user_former_groups.sql @@ -1,4 +1,4 @@ --- 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 diff --git a/maintenance/archives/patch-user_groups.sql b/maintenance/archives/patch-user_groups.sql index c3740332cd..1683cf2ad5 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 e30e00dc3a..85b00616ad 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 9866654c63..4947cb1f78 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*/; -- 2.20.1