X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Finstaller%2FDatabaseUpdater.php;h=7a1aba636cbcba661013c841a0af4b40ddb3eb95;hb=a68a0d610187d7ac913f1f266cae450607de1cf1;hp=2083500ed0b9cc6d7ed23f8f9ea69a15df9590b1;hpb=16ef3e79c4c52aa6b74563b7eadcfc9792e7a4c4;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/installer/DatabaseUpdater.php b/includes/installer/DatabaseUpdater.php index 2083500ed0..7a1aba636c 100644 --- a/includes/installer/DatabaseUpdater.php +++ b/includes/installer/DatabaseUpdater.php @@ -1047,7 +1047,7 @@ abstract class DatabaseUpdater { * Sets the number of active users in the site_stats table */ protected function doActiveUsersInit() { - $activeUsers = $this->db->selectField( 'site_stats', 'ss_active_users', false, __METHOD__ ); + $activeUsers = $this->db->selectField( 'site_stats', 'ss_active_users', '', __METHOD__ ); if ( $activeUsers == -1 ) { $activeUsers = $this->db->selectField( 'recentchanges', 'COUNT( DISTINCT rc_user_text )', @@ -1227,8 +1227,28 @@ abstract class DatabaseUpdater { "maintenance/migrateComments.php.\n" ); $task = $this->maintenance->runChild( MigrateComments::class, 'migrateComments.php' ); - $task->execute(); - $this->output( "done.\n" ); + $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 && + !$this->updateRowExists( 'MigrateActors' ) + ) { + $this->output( + "Migrating actors to the 'actor' table, printing progress markers. For large\n" . + "databases, you may want to hit Ctrl-C and do this manually with\n" . + "maintenance/migrateActors.php.\n" + ); + $task = $this->maintenance->runChild( 'MigrateActors', 'migrateActors.php' ); + $ok = $task->execute(); + $this->output( $ok ? "done.\n" : "errors were encountered.\n" ); } } @@ -1243,4 +1263,23 @@ abstract class DatabaseUpdater { $this->output( "done.\n" ); } + /** + * Populate ar_rev_id, then make it not nullable + * @since 1.31 + */ + protected function populateArchiveRevId() { + $info = $this->db->fieldInfo( 'archive', 'ar_rev_id', __METHOD__ ); + if ( !$info ) { + throw new MWException( 'Missing ar_rev_id field of archive table. Should not happen.' ); + } + if ( $info->isNullable() ) { + $this->output( "Populating ar_rev_id.\n" ); + $task = $this->maintenance->runChild( 'PopulateArchiveRevId', 'populateArchiveRevId.php' ); + if ( $task->execute() ) { + $this->applyPatch( 'patch-ar_rev_id-not-null.sql', false, + 'Making ar_rev_id not nullable' ); + } + } + } + }