protected function doDBUpdates() {
global $wgActorTableSchemaMigrationStage;
- if ( $wgActorTableSchemaMigrationStage < MIGRATION_WRITE_NEW ) {
+ if ( !( $wgActorTableSchemaMigrationStage & SCHEMA_COMPAT_WRITE_NEW ) ) {
$this->output(
- "...cannot update while \$wgActorTableSchemaMigrationStage < MIGRATION_WRITE_NEW\n"
+ "...cannot update while \$wgActorTableSchemaMigrationStage lacks SCHEMA_COMPAT_WRITE_NEW\n"
);
return false;
}
$this->output( "Creating actor entries for all registered users\n" );
$end = 0;
$dbw = $this->getDB( DB_MASTER );
- $max = $dbw->selectField( 'user', 'MAX(user_id)', false, __METHOD__ );
+ $max = $dbw->selectField( 'user', 'MAX(user_id)', '', __METHOD__ );
$count = 0;
while ( $end < $max ) {
$start = $end + 1;
$table,
[
$actorField => $row->actor_id,
- $nameField => '',
],
array_intersect_key( (array)$row, $pkFilter ) + [
$actorField => 0
}
$this->beginTransaction( $dbw, __METHOD__ );
$dbw->insert( $newTable, $inserts, __METHOD__ );
- $dbw->update( $table, [ $nameField => '' ], [ $primaryKey => $updates ], __METHOD__ );
$countUpdated += $dbw->affectedRows();
$this->commitTransaction( $dbw, __METHOD__ );
}