X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FfixUserRegistration.php;h=e1b16829892431524dc2a27a802209201bbf32d3;hb=5490b1270a0a7447f28d2407736fc3c1deb41d44;hp=f4674cb29412a8e2968018e0cc2b23ef43fcaf1d;hpb=ae69acacf567077b3f49d1fe6c3f3770e72a9093;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/fixUserRegistration.php b/maintenance/fixUserRegistration.php index f4674cb294..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 ) { @@ -80,12 +84,12 @@ class FixUserRegistration extends Maintenance { $this->output( "Could not find registration for #$id NULL\n" ); } } - $this->output( "Waiting for slaves..." ); + $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;