$t0 = microtime( true );
- if ( $wgMultiContentRevisionSchemaMigrationStage < MIGRATION_WRITE_BOTH ) {
+ if ( ( $wgMultiContentRevisionSchemaMigrationStage & SCHEMA_COMPAT_WRITE_NEW ) === 0 ) {
$this->writeln(
- "...cannot update while \$wgMultiContentRevisionSchemaMigrationStage < MIGRATION_WRITE_BOTH"
+ '...cannot update while \$wgMultiContentRevisionSchemaMigrationStage '
+ . 'does not have the SCHEMA_COMPAT_WRITE_NEW bit set.'
);
return false;
}
$elapsed = microtime( true ) - $t0;
$this->writeln( "Done. Processed $this->totalCount rows in $elapsed seconds" );
+ return true;
}
/**
'',
__METHOD__
);
+ if ( !$minmax || !is_numeric( $minmax->min ) || !is_numeric( $minmax->max ) ) {
+ // No rows?
+ $minmax = (object)[ 'min' => 1, 'max' => 0 ];
+ }
+
$batchSize = $this->getBatchSize();
for ( $startId = $minmax->min; $startId <= $minmax->max; $startId += $batchSize ) {