X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=maintenance%2FfixUserRegistration.php;h=e1b16829892431524dc2a27a802209201bbf32d3;hp=37fd44fb2e11eb6bc17c8a84499547026090b438;hb=27c61fb1e94da9114314468fd00bcf129ec064b6;hpb=c07567928973c22f1b85969f5ba20285e59b877d diff --git a/maintenance/fixUserRegistration.php b/maintenance/fixUserRegistration.php index 37fd44fb2e..e1b1682989 100644 --- a/maintenance/fixUserRegistration.php +++ b/maintenance/fixUserRegistration.php @@ -51,7 +51,7 @@ class FixUserRegistration extends Maintenance { ], __METHOD__, [ - 'LIMIT' => $this->mBatchSize, + 'LIMIT' => $this->getBatchSize(), 'ORDER BY' => 'user_id', ] ); @@ -59,11 +59,15 @@ class FixUserRegistration extends Maintenance { $id = $row->user_id; $lastId = $id; // Get first edit time + $actorQuery = ActorMigration::newMigration() + ->getWhere( $dbw, 'rev_user', User::newFromId( $id ) ); $timestamp = $dbw->selectField( - 'revision', + [ 'revision' ] + $actorQuery['tables'], 'MIN(rev_timestamp)', - [ 'rev_user' => $id ], - __METHOD__ + $actorQuery['conds'], + __METHOD__, + [], + $actorQuery['joins'] ); // Update if ( $timestamp !== null ) { @@ -83,9 +87,9 @@ class FixUserRegistration extends Maintenance { $this->output( "Waiting for replica DBs..." ); wfWaitForSlaves(); $this->output( " done.\n" ); - } while ( $res->numRows() >= $this->mBatchSize ); + } while ( $res->numRows() >= $this->getBatchSize() ); } } -$maintClass = "FixUserRegistration"; +$maintClass = FixUserRegistration::class; require_once RUN_MAINTENANCE_IF_MAIN;