- private function userSpecification( &$user, $idfield, $utfield ) {
- return [ $idfield => $user->getId(), $utfield => $user->getName() ];
+ private function userSpecification( IDatabase $dbw, &$user, $idfield, $utfield, $acfield ) {
+ global $wgActorTableSchemaMigrationStage;
+
+ $ret = [];
+ if ( $wgActorTableSchemaMigrationStage < MIGRATION_NEW ) {
+ $ret += [
+ $idfield => $user->getId(),
+ $utfield => $wgActorTableSchemaMigrationStage <= MIGRATION_WRITE_BOTH ? $user->getName() : '',
+ ];
+ }
+ if ( $wgActorTableSchemaMigrationStage > MIGRATION_OLD ) {
+ $ret += [ $acfield => $user->getActorId( $dbw ) ];
+ }
+ return $ret;