From: Sam Reed Date: Tue, 10 Jan 2012 14:07:32 +0000 (+0000) Subject: Noticed looking at schema posted by Joerg in bug 33228 X-Git-Tag: 1.31.0-rc.0~25372 X-Git-Url: http://git.cyclocoop.org/%22.%24h.%22?a=commitdiff_plain;h=a0cd1705e7c1bd009fd3a7bd480ff9a36cbc032e;p=lhc%2Fweb%2Fwiklou.git 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 --- 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__ ); + } + } + } }