(bug 32552) Drop unused database field cat_hidden
authorumherirrender <umherirrender_de.wp@web.de>
Fri, 3 Aug 2012 19:33:18 +0000 (21:33 +0200)
committerumherirrender <umherirrender_de.wp@web.de>
Thu, 6 Sep 2012 16:47:39 +0000 (18:47 +0200)
For the hiddencat feature the page prop table is used

Change-Id: If01d3394617ab8aec1a9b50c20bfe923df08732c

RELEASE-NOTES-1.20
includes/installer/MysqlUpdater.php
includes/installer/SqliteUpdater.php
maintenance/archives/patch-cat_hidden.sql [new file with mode: 0644]
maintenance/sqlite/archives/patch-cat_hidden.sql [new file with mode: 0644]
maintenance/tables.sql

index 51798c7..8dbb7de 100644 (file)
@@ -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.
index d93dba6..bd55cb4 100644 (file)
@@ -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' ),
                );
        }
 
index 9ba9eab..bc5fcac 100644 (file)
@@ -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 (file)
index 0000000..933188c
--- /dev/null
@@ -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 (file)
index 0000000..272b8ef
--- /dev/null
@@ -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);
index 0a5b2fb..062052f 100644 (file)
@@ -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);