X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Finstaller%2FDatabaseUpdater.php;h=019482227e321781254e6fc15d15192bf4799e58;hb=f33c501a59ff706d3a3f5a5c74acbd5a2bdf5626;hp=e49a846679bdde51c2ad230636448e12c1c209e2;hpb=d23c700ef7c58b92869aaf76e82cb801280e36d0;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/installer/DatabaseUpdater.php b/includes/installer/DatabaseUpdater.php index e49a846679..019482227e 100644 --- a/includes/installer/DatabaseUpdater.php +++ b/includes/installer/DatabaseUpdater.php @@ -34,6 +34,8 @@ require_once __DIR__ . '/../../maintenance/Maintenance.php'; * @since 1.17 */ abstract class DatabaseUpdater { + const REPLICATION_WAIT_TIMEOUT = 300; + /** * Array of updates to perform on the database * @@ -484,7 +486,7 @@ abstract class DatabaseUpdater { flush(); if ( $ret !== false ) { $updatesDone[] = $origParams; - $lbFactory->waitForReplication(); + $lbFactory->waitForReplication( [ 'timeout' => self::REPLICATION_WAIT_TIMEOUT ] ); } else { $updatesSkipped[] = [ $func, $params, $origParams ]; } @@ -1153,21 +1155,6 @@ abstract class DatabaseUpdater { } } - /** - * Updates the timestamps in the transcache table - * @return bool - */ - protected function doUpdateTranscacheField() { - if ( $this->updateRowExists( 'convert transcache field' ) ) { - $this->output( "...transcache tc_time already converted.\n" ); - - return true; - } - - return $this->applyPatch( 'patch-tc-timestamp.sql', false, - "Converting tc_time from UNIX epoch to MediaWiki timestamp" ); - } - /** * Update CategoryLinks collation */ @@ -1291,13 +1278,29 @@ abstract class DatabaseUpdater { } } + /** + * Merge `image_comment_temp` into the `image` table + * @since 1.32 + */ + protected function migrateImageCommentTemp() { + global $wgCommentTableSchemaMigrationStage; + if ( $wgCommentTableSchemaMigrationStage > MIGRATION_OLD ) { + $this->output( "Merging image_comment_temp into the image table\n" ); + $task = $this->maintenance->runChild( + MigrateImageCommentTemp::class, 'migrateImageCommentTemp.php' + ); + $ok = $task->execute(); + $this->output( $ok ? "done.\n" : "errors were encountered.\n" ); + } + } + /** * Migrate actors to the new 'actor' table * @since 1.31 */ protected function migrateActors() { global $wgActorTableSchemaMigrationStage; - if ( $wgActorTableSchemaMigrationStage >= MIGRATION_WRITE_NEW && + if ( ( $wgActorTableSchemaMigrationStage & SCHEMA_COMPAT_WRITE_NEW ) && !$this->updateRowExists( 'MigrateActors' ) ) { $this->output(