X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Finstaller%2FDatabaseUpdater.php;h=752bc5445bf5ffe3d2ebc0daa065117beef4fafb;hb=74dae1802eff7f497d95d88bad3474df52e8fd52;hp=7e43fb5801b7dec624ef410e7b5554460ad44c63;hpb=244e29b2c9e0b68c1fcbaab2f20364860d9c58ff;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/installer/DatabaseUpdater.php b/includes/installer/DatabaseUpdater.php index 7e43fb5801..752bc5445b 100644 --- a/includes/installer/DatabaseUpdater.php +++ b/includes/installer/DatabaseUpdater.php @@ -83,6 +83,8 @@ abstract class DatabaseUpdater { FixDefaultJsonContentPages::class, CleanupEmptyCategories::class, AddRFCAndPMIDInterwiki::class, + PopulatePPSortKey::class, + PopulateIpChanges::class, ]; /** @@ -105,7 +107,7 @@ abstract class DatabaseUpdater { protected $holdContentHandlerUseDB = true; /** - * @param Database $db To perform updates on + * @param Database &$db To perform updates on * @param bool $shared Whether to perform updates on shared tables * @param Maintenance $maintenance Maintenance object which created us */ @@ -939,10 +941,10 @@ abstract class DatabaseUpdater { * * @param string $table Name of the table to modify * @param string $patch Name of the patch file to apply - * @param string $fullpath Whether to treat $patch path as relative or not, defaults to false + * @param string|bool $fullpath Whether to treat $patch path as relative or not, defaults to false * @return bool False if this was skipped because of schema changes being skipped */ - public function modifyTable( $table, $patch, $fullpath = false ) { + public function modifyTable( $table, $patch, $fullpath = false ) { if ( !$this->doTable( $table ) ) { return true; } @@ -1189,4 +1191,25 @@ abstract class DatabaseUpdater { $wgContentHandlerUseDB = $this->holdContentHandlerUseDB; } } + + /** + * Migrate comments to the new 'comment' table + * @since 1.30 + */ + protected function migrateComments() { + global $wgCommentTableSchemaMigrationStage; + if ( $wgCommentTableSchemaMigrationStage >= MIGRATION_WRITE_NEW && + !$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" . + "maintenance/migrateComments.php.\n" + ); + $task = $this->maintenance->runChild( 'MigrateComments', 'migrateComments.php' ); + $task->execute(); + $this->output( "done.\n" ); + } + } + }