Noticed looking at schema posted by Joerg in bug 33228
authorSam Reed <reedy@users.mediawiki.org>
Tue, 10 Jan 2012 14:07:32 +0000 (14:07 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Tue, 10 Jan 2012 14:07:32 +0000 (14:07 +0000)
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

index a5ffea4..e92e31c 100644 (file)
@@ -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__ );
+                       }
+               }
+       }
 }