diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2014-12-27 15:41:37 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2014-12-31 11:43:28 +0100 |
commit | c1f9b1f7b1b77776192048005dcc66dcf3df2bfb (patch) | |
tree | 2b38796e738dd74cb42ecd9bfd151803108386bc /maintenance/archives | |
parent | b88ab0086858470dd1f644e64cb4e4f62bb2be9b (diff) |
Update to MediaWiki 1.24.1
Diffstat (limited to 'maintenance/archives')
23 files changed, 70 insertions, 169 deletions
diff --git a/maintenance/archives/patch-drop-rc_cur_time.sql b/maintenance/archives/patch-drop-rc_cur_time.sql new file mode 100644 index 00000000..f1bc9e8b --- /dev/null +++ b/maintenance/archives/patch-drop-rc_cur_time.sql @@ -0,0 +1,2 @@ +-- rc_cur_time is no longer used, delete the field +ALTER TABLE /*$wgDBprefix*/recentchanges DROP COLUMN rc_cur_time;
\ No newline at end of file diff --git a/maintenance/archives/patch-fa_major_mime-chemical.sql b/maintenance/archives/patch-fa_major_mime-chemical.sql new file mode 100644 index 00000000..be9b0ff5 --- /dev/null +++ b/maintenance/archives/patch-fa_major_mime-chemical.sql @@ -0,0 +1,3 @@ +ALTER TABLE /*$wgDBprefix*/filearchive + CHANGE fa_major_mime fa_major_mime ENUM('unknown','application','audio','image','text','video','message','model','multipart','chemical'); + diff --git a/maintenance/archives/patch-hitcounter.sql b/maintenance/archives/patch-hitcounter.sql index c87c9592..2d698f68 100644 --- a/maintenance/archives/patch-hitcounter.sql +++ b/maintenance/archives/patch-hitcounter.sql @@ -6,4 +6,4 @@ CREATE TABLE /*$wgDBprefix*/hitcounter ( hc_id INTEGER UNSIGNED NOT NULL -) ENGINE=HEAP MAX_ROWS=25000; +) ENGINE=MEMORY MAX_ROWS=25000; diff --git a/maintenance/archives/patch-il_from_namespace.sql b/maintenance/archives/patch-il_from_namespace.sql new file mode 100644 index 00000000..4c858f44 --- /dev/null +++ b/maintenance/archives/patch-il_from_namespace.sql @@ -0,0 +1,4 @@ +ALTER TABLE /*_*/imagelinks + ADD COLUMN il_from_namespace int NOT NULL default 0; + +CREATE INDEX /*i*/il_backlinks_namespace ON /*_*/imagelinks (il_to,il_from_namespace,il_from);
\ No newline at end of file diff --git a/maintenance/archives/patch-img_major_mime-chemical.sql b/maintenance/archives/patch-img_major_mime-chemical.sql new file mode 100644 index 00000000..4bde446e --- /dev/null +++ b/maintenance/archives/patch-img_major_mime-chemical.sql @@ -0,0 +1,3 @@ +ALTER TABLE /*$wgDBprefix*/image + CHANGE img_major_mime img_major_mime ENUM('unknown','application','audio','image','text','video','message','model','multipart','chemical'); + diff --git a/maintenance/archives/patch-logging_user_text_time_index.sql b/maintenance/archives/patch-logging_user_text_time_index.sql new file mode 100644 index 00000000..06f29861 --- /dev/null +++ b/maintenance/archives/patch-logging_user_text_time_index.sql @@ -0,0 +1 @@ +CREATE INDEX /*i*/log_user_text_time ON /*_*/logging (log_user_text, log_timestamp); diff --git a/maintenance/archives/patch-logging_user_text_type_time_index.sql b/maintenance/archives/patch-logging_user_text_type_time_index.sql new file mode 100644 index 00000000..2801bc86 --- /dev/null +++ b/maintenance/archives/patch-logging_user_text_type_time_index.sql @@ -0,0 +1 @@ +CREATE INDEX /*i*/log_user_text_type_time ON /*_*/logging (log_user_text, log_type, log_timestamp); diff --git a/maintenance/archives/patch-mimesearch-indexes.sql b/maintenance/archives/patch-mimesearch-indexes.sql index bd348c46..8d9426ea 100644 --- a/maintenance/archives/patch-mimesearch-indexes.sql +++ b/maintenance/archives/patch-mimesearch-indexes.sql @@ -1,4 +1,4 @@ --- Add indexes to the mime types in image for use on Special:MIMEsearch, +-- Add indexes to the MIME types in image for use on Special:MIMEsearch, -- changes a query like -- -- SELECT img_name FROM image WHERE img_major_mime = "image" AND img_minor_mime = "svg"; diff --git a/maintenance/archives/patch-oi_major_mime-chemical.sql b/maintenance/archives/patch-oi_major_mime-chemical.sql new file mode 100644 index 00000000..e3b4552d --- /dev/null +++ b/maintenance/archives/patch-oi_major_mime-chemical.sql @@ -0,0 +1,3 @@ +ALTER TABLE /*$wgDBprefix*/oldimage + CHANGE oi_major_mime oi_major_mime ENUM('unknown','application','audio','image','text','video','message','model','multipart','chemical'); + diff --git a/maintenance/archives/patch-page_lang.sql b/maintenance/archives/patch-page_lang.sql new file mode 100644 index 00000000..c792b4ad --- /dev/null +++ b/maintenance/archives/patch-page_lang.sql @@ -0,0 +1,2 @@ +ALTER TABLE /*$wgDBprefix*/page + ADD page_lang varbinary(35) DEFAULT NULL; diff --git a/maintenance/archives/patch-page_links_updated.sql b/maintenance/archives/patch-page_links_updated.sql new file mode 100644 index 00000000..18d9e2d9 --- /dev/null +++ b/maintenance/archives/patch-page_links_updated.sql @@ -0,0 +1,2 @@ +ALTER TABLE /*$wgDBprefix*/page + ADD page_links_updated varbinary(14) NULL default NULL; diff --git a/maintenance/archives/patch-pl_from_namespace.sql b/maintenance/archives/patch-pl_from_namespace.sql new file mode 100644 index 00000000..2f7ff046 --- /dev/null +++ b/maintenance/archives/patch-pl_from_namespace.sql @@ -0,0 +1,4 @@ +ALTER TABLE /*_*/pagelinks + ADD COLUMN pl_from_namespace int NOT NULL default 0; + +CREATE INDEX /*i*/pl_backlinks_namespace ON /*_*/pagelinks (pl_namespace,pl_title,pl_from_namespace,pl_from); diff --git a/maintenance/archives/patch-pp_sortkey.sql b/maintenance/archives/patch-pp_sortkey.sql new file mode 100644 index 00000000..b13b6055 --- /dev/null +++ b/maintenance/archives/patch-pp_sortkey.sql @@ -0,0 +1,8 @@ +-- Add a 'sortkey' field to page_props so pages can be efficiently +-- queried by the numeric value of a property. + +ALTER TABLE /*_*/page_props + ADD pp_sortkey float DEFAULT NULL; + +CREATE UNIQUE INDEX /*i*/pp_propname_sortkey_page + ON /*_*/page_props ( pp_propname, pp_sortkey, pp_page ); diff --git a/maintenance/archives/patch-profiling.sql b/maintenance/archives/patch-profiling.sql index 0a0e4e1a..6ad16224 100644 --- a/maintenance/archives/patch-profiling.sql +++ b/maintenance/archives/patch-profiling.sql @@ -7,6 +7,6 @@ CREATE TABLE /*_*/profiling ( pf_memory float NOT NULL default 0, pf_name varchar(255) NOT NULL default '', pf_server varchar(30) NOT NULL default '' -) ENGINE=HEAP; +) ENGINE=MEMORY; CREATE UNIQUE INDEX /*i*/pf_name_server ON /*_*/profiling (pf_name, pf_server);
\ No newline at end of file diff --git a/maintenance/archives/patch-rc_source.sql b/maintenance/archives/patch-rc_source.sql new file mode 100644 index 00000000..7dedd745 --- /dev/null +++ b/maintenance/archives/patch-rc_source.sql @@ -0,0 +1,16 @@ +-- first step of migrating recentchanges rc_type to rc_source +ALTER TABLE /*$wgDBprefix*/recentchanges + ADD rc_source varbinary(16) NOT NULL default ''; + +-- Populate rc_source field with the data from rc_type +-- Large wiki's might prefer the PopulateRecentChangeSource maintenance +-- script to batch updates into groups rather than all at once. +UPDATE /*$wgDBprefix*/recentchanges + SET rc_source = CASE + WHEN rc_type = 0 THEN 'mw.edit' + WHEN rc_type = 1 THEN 'mw.new' + WHEN rc_type = 3 THEN 'mw.log' + WHEN rc_type = 5 THEN 'mw.external' + ELSE '' + END +WHERE rc_source = ''; diff --git a/maintenance/archives/patch-restructure.sql b/maintenance/archives/patch-restructure.sql deleted file mode 100644 index a5bc3e52..00000000 --- a/maintenance/archives/patch-restructure.sql +++ /dev/null @@ -1,146 +0,0 @@ --- The Great Restructuring of October 2004 --- Creates 'page', 'revision' tables and transforms the classic --- cur+old into a separate page+revision+text structure. --- --- The pre-conversion 'old' table is renamed to 'text' and used --- without internal restructuring to avoid rebuilding the entire --- table. (This can be done separately if desired.) --- --- The pre-conversion 'cur' table is now redundant and can be --- discarded when done. - -CREATE TABLE /*$wgDBprefix*/page ( - page_id int unsigned NOT NULL auto_increment, - page_namespace tinyint NOT NULL, - page_title varchar(255) binary NOT NULL, - page_restrictions tinyblob NOT NULL, - page_counter bigint unsigned NOT NULL default '0', - page_is_redirect tinyint unsigned NOT NULL default '0', - page_is_new tinyint unsigned NOT NULL default '0', - page_random real unsigned NOT NULL, - page_touched binary(14) NOT NULL default '', - page_latest int unsigned NOT NULL, - page_len int unsigned NOT NULL, - - PRIMARY KEY page_id (page_id), - UNIQUE INDEX name_title (page_namespace,page_title), - INDEX (page_random), - INDEX (page_len) -); - -CREATE TABLE /*$wgDBprefix*/revision ( - rev_id int unsigned NOT NULL auto_increment, - rev_page int unsigned NOT NULL, - rev_comment tinyblob NOT NULL, - rev_user int unsigned NOT NULL default '0', - rev_user_text varchar(255) binary NOT NULL default '', - rev_timestamp binary(14) NOT NULL default '', - 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), - INDEX page_timestamp (rev_page,rev_timestamp), - INDEX user_timestamp (rev_user,rev_timestamp), - INDEX usertext_timestamp (rev_user_text,rev_timestamp) -); - --- If creating new 'text' table it would look like this: --- --- CREATE TABLE /*$wgDBprefix*/text ( --- 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) --- ); - - --- Lock! -LOCK TABLES /*$wgDBprefix*/page WRITE, /*$wgDBprefix*/revision WRITE, /*$wgDBprefix*/old WRITE, /*$wgDBprefix*/cur WRITE; - --- Save the last old_id value for later -SELECT (@maxold:=MAX(old_id)) FROM /*$wgDBprefix*/old; - --- First, copy all current entries into the old table. -INSERT - INTO /*$wgDBprefix*/old - (old_namespace, - old_title, - old_text, - old_comment, - old_user, - old_user_text, - old_timestamp, - old_minor_edit, - old_flags) - SELECT - cur_namespace, - cur_title, - cur_text, - cur_comment, - cur_user, - cur_user_text, - cur_timestamp, - cur_minor_edit, - '' - FROM /*$wgDBprefix*/cur; - --- Now, copy all old data except the text into revisions -INSERT - INTO /*$wgDBprefix*/revision - (rev_id, - rev_page, - rev_comment, - rev_user, - rev_user_text, - rev_timestamp, - rev_minor_edit) - SELECT - old_id, - cur_id, - old_comment, - old_user, - old_user_text, - old_timestamp, - old_minor_edit - FROM /*$wgDBprefix*/old,/*$wgDBprefix*/cur - WHERE old_namespace=cur_namespace - AND old_title=cur_title; - --- And, copy the cur data into page -INSERT - INTO /*$wgDBprefix*/page - (page_id, - page_namespace, - page_title, - page_restrictions, - page_counter, - page_is_redirect, - page_is_new, - page_random, - page_touched, - page_latest) - SELECT - cur_id, - cur_namespace, - cur_title, - cur_restrictions, - cur_counter, - cur_is_redirect, - cur_is_new, - cur_random, - cur_touched, - rev_id - FROM /*$wgDBprefix*/cur,/*$wgDBprefix*/revision - WHERE cur_id=rev_page - AND rev_timestamp=cur_timestamp - AND rev_id > @maxold; - -UNLOCK TABLES; - --- Keep the old table around as the text store. --- Its extra fields will be ignored, but trimming them is slow --- so we won't bother doing it for now. -ALTER TABLE /*$wgDBprefix*/old RENAME TO /*$wgDBprefix*/text; diff --git a/maintenance/archives/patch-tl_from_namespace.sql b/maintenance/archives/patch-tl_from_namespace.sql new file mode 100644 index 00000000..8d6c76b8 --- /dev/null +++ b/maintenance/archives/patch-tl_from_namespace.sql @@ -0,0 +1,4 @@ +ALTER TABLE /*_*/templatelinks + ADD COLUMN tl_from_namespace int NOT NULL default 0; + +CREATE INDEX /*i*/tl_backlinks_namespace ON /*_*/templatelinks (tl_namespace,tl_title,tl_from_namespace,tl_from); diff --git a/maintenance/archives/patch-uploadstash.sql b/maintenance/archives/patch-uploadstash.sql index 14eaeab0..c1d93ef3 100644 --- a/maintenance/archives/patch-uploadstash.sql +++ b/maintenance/archives/patch-uploadstash.sql @@ -26,10 +26,10 @@ CREATE TABLE /*_*/uploadstash ( us_status varchar(50) not null, - -- file properties from File::getPropsFromPath. these may prove unnecessary. + -- file properties from FSFile::getProps(). these may prove unnecessary. -- us_size int unsigned NOT NULL, - -- this hash comes from File::sha1Base36(), and is 31 characters + -- this hash comes from FSFile::getSha1Base36(), and is 31 characters 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 diff --git a/maintenance/archives/patch-user_password_expire.sql b/maintenance/archives/patch-user_password_expire.sql new file mode 100644 index 00000000..3e716d33 --- /dev/null +++ b/maintenance/archives/patch-user_password_expire.sql @@ -0,0 +1,3 @@ +-- For setting a password expiration date for users +ALTER TABLE /*$wgDBprefix*/user + ADD COLUMN user_password_expires varbinary(14) DEFAULT NULL; diff --git a/maintenance/archives/patch-val_ip.sql b/maintenance/archives/patch-val_ip.sql deleted file mode 100644 index 9214218d..00000000 --- a/maintenance/archives/patch-val_ip.sql +++ /dev/null @@ -1,4 +0,0 @@ --- Column added 2005-05-24 - -ALTER TABLE /*$wgDBprefix*/validate - ADD COLUMN val_ip varchar(20) NOT NULL default ''; diff --git a/maintenance/archives/patch-validate.sql b/maintenance/archives/patch-validate.sql deleted file mode 100644 index 9701083c..00000000 --- a/maintenance/archives/patch-validate.sql +++ /dev/null @@ -1,13 +0,0 @@ --- For article validation - -DROP TABLE IF EXISTS /*$wgDBprefix*/validate; -CREATE TABLE /*$wgDBprefix*/validate ( - `val_user` int(11) NOT NULL default '0', - `val_page` int(11) unsigned NOT NULL default '0', - `val_revision` int(11) unsigned NOT NULL default '0', - `val_type` int(11) unsigned NOT NULL default '0', - `val_value` int(11) default '0', - `val_comment` varchar(255) NOT NULL default '', - `val_ip` varchar(20) NOT NULL default '', - KEY `val_user` (`val_user`,`val_revision`) -) /*$wgDBTableOptions*/; diff --git a/maintenance/archives/patch-watchlist-user-notificationtimestamp-index.sql b/maintenance/archives/patch-watchlist-user-notificationtimestamp-index.sql new file mode 100644 index 00000000..22ae44f1 --- /dev/null +++ b/maintenance/archives/patch-watchlist-user-notificationtimestamp-index.sql @@ -0,0 +1,4 @@ +-- +-- Creates the wl_user_notificationtimestamp index for the watchlist table +-- +CREATE INDEX /*i*/wl_user_notificationtimestamp ON /*_*/watchlist (wl_user, wl_notificationtimestamp); diff --git a/maintenance/archives/upgradeLogging.php b/maintenance/archives/upgradeLogging.php index 0749bbf6..aeadc93d 100644 --- a/maintenance/archives/upgradeLogging.php +++ b/maintenance/archives/upgradeLogging.php @@ -52,6 +52,7 @@ class UpdateLogging { if ( $this->dbw->tableExists( 'logging_pre_1_10' ) ) { echo "This script has already been run to completion\n"; + return; } @@ -124,6 +125,8 @@ EOT; /** * Copy all rows from $srcTable to $dstTable + * @param string $srcTable + * @param string $dstTable */ function sync( $srcTable, $dstTable ) { $batchSize = 1000; @@ -158,7 +161,7 @@ EOT; $srcRes = $this->dbw->select( $srcTable, '*', $conds, __METHOD__, array( 'LIMIT' => $batchSize, 'ORDER BY' => 'log_timestamp' ) ); - if ( ! $srcRes->numRows() ) { + if ( !$srcRes->numRows() ) { # All done break; } @@ -205,6 +208,7 @@ EOT; } } } + return $numRowsCopied; } } |