}
protected function doDBUpdates() {
- global $wgActorTableSchemaMigrationStage;
-
- if ( !( $wgActorTableSchemaMigrationStage & SCHEMA_COMPAT_WRITE_NEW ) ) {
- $this->output(
- "...cannot update while \$wgActorTableSchemaMigrationStage lacks SCHEMA_COMPAT_WRITE_NEW\n"
- );
- return false;
- }
-
$tables = $this->getOption( 'tables' );
if ( $tables !== null ) {
$this->tables = explode( ',', $tables );
return 0;
}
+ $dbw = $this->getDB( DB_MASTER );
+ if ( !$dbw->fieldExists( $table, $userField, __METHOD__ ) ) {
+ $this->output( "No need to migrate $table.$userField, field does not exist\n" );
+ return 0;
+ }
+
$complainedAboutUsers = [];
$primaryKey = (array)$primaryKey;
);
wfWaitForSlaves();
- $dbw = $this->getDB( DB_MASTER );
$actorIdSubquery = $this->makeActorIdSubquery( $dbw, $userField, $nameField );
$next = '1=1';
$countUpdated = 0;
* @param string $nameField User name field name
* @param string $newPrimaryKey Primary key of the new table.
* @param string $actorField Actor field name
+ * @return int Number of errors
*/
protected function migrateToTemp(
$table, $primaryKey, $extra, $userField, $nameField, $newPrimaryKey, $actorField
return 0;
}
+ $dbw = $this->getDB( DB_MASTER );
+ if ( !$dbw->fieldExists( $table, $userField, __METHOD__ ) ) {
+ $this->output( "No need to migrate $table.$userField, field does not exist\n" );
+ return 0;
+ }
+
$complainedAboutUsers = [];
$newTable = $table . '_actor_temp';
);
wfWaitForSlaves();
- $dbw = $this->getDB( DB_MASTER );
$actorIdSubquery = $this->makeActorIdSubquery( $dbw, $userField, $nameField );
$next = [];
$countUpdated = 0;