From a0cd1705e7c1bd009fd3a7bd480ff9a36cbc032e Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Tue, 10 Jan 2012 14:07:32 +0000 Subject: [PATCH] Noticed looking at schema posted by Joerg in bug 33228 It seems many ancient tables (removed mainly in 1.4, and some in 1.6) Kill them with fire, if they've still got unmigrated data in or something, we've got bigger issues! Noticed "user_rights" table is not documented at Manual:Database_layout --- includes/installer/MysqlUpdater.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/includes/installer/MysqlUpdater.php b/includes/installer/MysqlUpdater.php index a5ffea4e24..e92e31c8b1 100644 --- a/includes/installer/MysqlUpdater.php +++ b/includes/installer/MysqlUpdater.php @@ -192,6 +192,7 @@ class MysqlUpdater extends DatabaseUpdater { array( 'modifyField', 'user', 'ug_group', 'patch-ug_group-length-increase.sql' ), array( 'addField', 'uploadstash', 'us_chunk_inx', 'patch-uploadstash_chunk.sql' ), array( 'addfield', 'job', 'job_timestamp', 'patch-jobs-add-timestamp.sql' ), + array( 'dropAncientTables' ), ); } @@ -853,4 +854,25 @@ class MysqlUpdater extends DatabaseUpdater { $this->applyPatch( 'patch-user-newtalk-timestamp-null.sql' ); $this->output( "done.\n" ); } + + protected function dropAncientTables() { + $ancientTables = array( + 'blobs', // 1.4 + 'brokenlinks', // 1.4 + 'cur', // 1.4 + 'ip_blocks_old', // Temporary in 1.6 + 'links', // 1.4 + 'linkscc', // 1.4 + 'old', // 1.4 + 'trackback', // 1.19 + 'user_rights', // 1.5 + 'validate', // 1.6 + ); + + foreach( $ancientTables as $table ) { + if ( $this->db->tableExists( $table, __METHOD__ ) ) { + $this->db->dropTable( $table, __METHOD__ ); + } + } + } } -- 2.20.1