Mostly drop old comment schemas
[lhc/web/wiklou.git] / includes / installer / DatabaseUpdater.php
index f5d01d6..d64e2d7 100644 (file)
@@ -87,6 +87,7 @@ abstract class DatabaseUpdater {
                AddRFCandPMIDInterwiki::class,
                PopulatePPSortKey::class,
                PopulateIpChanges::class,
+               RefreshExternallinksIndex::class,
        ];
 
        /**
@@ -1260,10 +1261,7 @@ abstract class DatabaseUpdater {
         * @since 1.30
         */
        protected function migrateComments() {
-               global $wgCommentTableSchemaMigrationStage;
-               if ( $wgCommentTableSchemaMigrationStage >= MIGRATION_WRITE_NEW &&
-                       !$this->updateRowExists( 'MigrateComments' )
-               ) {
+               if ( !$this->updateRowExists( 'MigrateComments' ) ) {
                        $this->output(
                                "Migrating comments to the 'comments' table, printing progress markers. For large\n" .
                                "databases, you may want to hit Ctrl-C and do this manually with\n" .
@@ -1280,14 +1278,17 @@ abstract class DatabaseUpdater {
         * @since 1.32
         */
        protected function migrateImageCommentTemp() {
-               global $wgCommentTableSchemaMigrationStage;
-               if ( $wgCommentTableSchemaMigrationStage > MIGRATION_OLD ) {
+               if ( $this->tableExists( 'image_comment_temp' ) ) {
                        $this->output( "Merging image_comment_temp into the image table\n" );
                        $task = $this->maintenance->runChild(
                                MigrateImageCommentTemp::class, 'migrateImageCommentTemp.php'
                        );
+                       $task->setForce();
                        $ok = $task->execute();
                        $this->output( $ok ? "done.\n" : "errors were encountered.\n" );
+                       if ( $ok ) {
+                               $this->dropTable( 'image_comment_temp' );
+                       }
                }
        }