From 0cbc85494d47cdeb2219dccf7cc3c7321333422f Mon Sep 17 00:00:00 2001 From: umherirrender Date: Fri, 3 Aug 2012 21:33:18 +0200 Subject: [PATCH] (bug 32552) Drop unused database field cat_hidden For the hiddencat feature the page prop table is used Change-Id: If01d3394617ab8aec1a9b50c20bfe923df08732c --- RELEASE-NOTES-1.20 | 1 + includes/installer/MysqlUpdater.php | 1 + includes/installer/SqliteUpdater.php | 1 + maintenance/archives/patch-cat_hidden.sql | 3 +++ .../sqlite/archives/patch-cat_hidden.sql | 20 +++++++++++++++++++ maintenance/tables.sql | 5 +---- 6 files changed, 27 insertions(+), 4 deletions(-) create mode 100644 maintenance/archives/patch-cat_hidden.sql create mode 100644 maintenance/sqlite/archives/patch-cat_hidden.sql diff --git a/RELEASE-NOTES-1.20 b/RELEASE-NOTES-1.20 index 51798c7a69..8dbb7ded77 100644 --- a/RELEASE-NOTES-1.20 +++ b/RELEASE-NOTES-1.20 @@ -237,6 +237,7 @@ upgrade PHP if you have not done so prior to upgrading MediaWiki. * (bug 36761) "Mark pages as visited" now submits previously established filter options. * (bug 39635) PostgreSQL LOCK IN SHARE MODE option is a syntax error. * (bug 36329) Accesskey tooltips for Firefox 14 on Mac should use "ctrl-option-" prefix. +* (bug 32552) Drop unused database field cat_hidden from table category. === API changes in 1.20 === * (bug 34316) Add ability to retrieve maximum upload size from MediaWiki API. diff --git a/includes/installer/MysqlUpdater.php b/includes/installer/MysqlUpdater.php index d93dba69ea..bd55cb4084 100644 --- a/includes/installer/MysqlUpdater.php +++ b/includes/installer/MysqlUpdater.php @@ -213,6 +213,7 @@ class MysqlUpdater extends DatabaseUpdater { array( 'addIndex', 'revision', 'page_user_timestamp', 'patch-revision-user-page-index.sql' ), array( 'addField', 'ipblocks', 'ipb_parent_block_id', 'patch-ipb-parent-block-id.sql' ), array( 'addIndex', 'ipblocks', 'ipb_parent_block_id', 'patch-ipb-parent-block-id-index.sql' ), + array( 'dropField', 'category', 'cat_hidden', 'patch-cat_hidden.sql' ), ); } diff --git a/includes/installer/SqliteUpdater.php b/includes/installer/SqliteUpdater.php index 9ba9eab2ae..bc5fcacfb5 100644 --- a/includes/installer/SqliteUpdater.php +++ b/includes/installer/SqliteUpdater.php @@ -92,6 +92,7 @@ class SqliteUpdater extends DatabaseUpdater { array( 'addIndex', 'revision', 'page_user_timestamp', 'patch-revision-user-page-index.sql' ), array( 'addField', 'ipblocks', 'ipb_parent_block_id', 'patch-ipb-parent-block-id.sql' ), array( 'addIndex', 'ipblocks', 'ipb_parent_block_id', 'patch-ipb-parent-block-id-index.sql' ), + array( 'dropField', 'category', 'cat_hidden', 'patch-cat_hidden.sql' ), ); } diff --git a/maintenance/archives/patch-cat_hidden.sql b/maintenance/archives/patch-cat_hidden.sql new file mode 100644 index 0000000000..933188ce72 --- /dev/null +++ b/maintenance/archives/patch-cat_hidden.sql @@ -0,0 +1,3 @@ +-- cat_hidden is no longer used, delete it + +ALTER TABLE /*$wgDBprefix*/category DROP COLUMN cat_hidden; diff --git a/maintenance/sqlite/archives/patch-cat_hidden.sql b/maintenance/sqlite/archives/patch-cat_hidden.sql new file mode 100644 index 0000000000..272b8ef3d5 --- /dev/null +++ b/maintenance/sqlite/archives/patch-cat_hidden.sql @@ -0,0 +1,20 @@ +-- cat_hidden is no longer used, delete it + +CREATE TABLE /*_*/category_tmp ( + cat_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT, + cat_title varchar(255) binary NOT NULL, + cat_pages int signed NOT NULL default 0, + cat_subcats int signed NOT NULL default 0, + cat_files int signed NOT NULL default 0 +) /*$wgDBTableOptions*/; + +INSERT INTO /*_*/category_tmp + SELECT cat_id, cat_title, cat_pages, cat_subcats, cat_files + FROM /*_*/category; + +DROP TABLE /*_*/category; + +ALTER TABLE /*_*/category_tmp RENAME TO /*_*/category; + +CREATE UNIQUE INDEX /*i*/cat_title ON /*_*/category (cat_title); +CREATE INDEX /*i*/cat_pages ON /*_*/category (cat_pages); diff --git a/maintenance/tables.sql b/maintenance/tables.sql index 0a5b2fb75a..062052f77c 100644 --- a/maintenance/tables.sql +++ b/maintenance/tables.sql @@ -571,10 +571,7 @@ CREATE TABLE /*_*/category ( -- ing is not. cat_pages int signed NOT NULL default 0, cat_subcats int signed NOT NULL default 0, - cat_files int signed NOT NULL default 0, - - -- Reserved for future use - cat_hidden tinyint unsigned NOT NULL default 0 + cat_files int signed NOT NULL default 0 ) /*$wgDBTableOptions*/; CREATE UNIQUE INDEX /*i*/cat_title ON /*_*/category (cat_title); -- 2.20.1