dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Fix use of GenderCache in ApiPageSet::processTitlesArray"
[lhc/web/wiklou.git]
/
maintenance
/
includes
/
MigrateActors.php
diff --git
a/maintenance/includes/MigrateActors.php
b/maintenance/includes/MigrateActors.php
index
1b35a20
..
48dcf8d
100644
(file)
--- a/
maintenance/includes/MigrateActors.php
+++ b/
maintenance/includes/MigrateActors.php
@@
-51,15
+51,6
@@
class MigrateActors extends LoggedUpdateMaintenance {
}
protected function doDBUpdates() {
}
protected function doDBUpdates() {
- $actorTableSchemaMigrationStage = $this->getConfig()->get( 'ActorTableSchemaMigrationStage' );
-
- if ( !( $actorTableSchemaMigrationStage & 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 );
$tables = $this->getOption( 'tables' );
if ( $tables !== null ) {
$this->tables = explode( ',', $tables );
@@
-265,6
+256,12
@@
class MigrateActors extends LoggedUpdateMaintenance {
return 0;
}
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;
$complainedAboutUsers = [];
$primaryKey = (array)$primaryKey;
@@
-274,7
+271,6
@@
class MigrateActors extends LoggedUpdateMaintenance {
);
wfWaitForSlaves();
);
wfWaitForSlaves();
- $dbw = $this->getDB( DB_MASTER );
$actorIdSubquery = $this->makeActorIdSubquery( $dbw, $userField, $nameField );
$next = '1=1';
$countUpdated = 0;
$actorIdSubquery = $this->makeActorIdSubquery( $dbw, $userField, $nameField );
$next = '1=1';
$countUpdated = 0;
@@
-357,6
+353,7
@@
class MigrateActors extends LoggedUpdateMaintenance {
* @param string $nameField User name field name
* @param string $newPrimaryKey Primary key of the new table.
* @param string $actorField Actor field name
* @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
*/
protected function migrateToTemp(
$table, $primaryKey, $extra, $userField, $nameField, $newPrimaryKey, $actorField
@@
-366,6
+363,12
@@
class MigrateActors extends LoggedUpdateMaintenance {
return 0;
}
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';
$complainedAboutUsers = [];
$newTable = $table . '_actor_temp';
@@
-374,7
+377,6
@@
class MigrateActors extends LoggedUpdateMaintenance {
);
wfWaitForSlaves();
);
wfWaitForSlaves();
- $dbw = $this->getDB( DB_MASTER );
$actorIdSubquery = $this->makeActorIdSubquery( $dbw, $userField, $nameField );
$next = [];
$countUpdated = 0;
$actorIdSubquery = $this->makeActorIdSubquery( $dbw, $userField, $nameField );
$next = [];
$countUpdated = 0;