X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;ds=sidebyside;f=maintenance%2FpopulateIpChanges.php;h=517475886ffb7e690d41139b75d1a9aa06abc81b;hb=27c61fb1e94da9114314468fd00bcf129ec064b6;hp=fbe16de5418a5bb5264ad4775ad119142d28de77;hpb=577f3d79115173f4dd16bb46f6d0ef2c82b55add;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/populateIpChanges.php b/maintenance/populateIpChanges.php index fbe16de541..517475886f 100644 --- a/maintenance/populateIpChanges.php +++ b/maintenance/populateIpChanges.php @@ -82,13 +82,19 @@ TEXT $this->output( "Copying IP revisions to ip_changes, from rev_id $start to rev_id $end\n" ); + $actorMigration = ActorMigration::newMigration(); + $actorQuery = $actorMigration->getJoin( 'rev_user' ); + $revUserIsAnon = $actorMigration->isAnon( $actorQuery['fields']['rev_user'] ); + while ( $blockStart <= $end ) { $blockEnd = min( $blockStart + $this->getBatchSize(), $end ); $rows = $dbr->select( - 'revision', - [ 'rev_id', 'rev_timestamp', 'rev_user_text' ], - [ "rev_id BETWEEN " . (int)$blockStart . " AND " . (int)$blockEnd, 'rev_user' => 0 ], - __METHOD__ + [ 'revision' ] + $actorQuery['tables'], + [ 'rev_id', 'rev_timestamp', 'rev_user_text' => $actorQuery['fields']['rev_user_text'] ], + [ "rev_id BETWEEN " . (int)$blockStart . " AND " . (int)$blockEnd, $revUserIsAnon ], + __METHOD__, + [], + $actorQuery['joins'] ); $numRows = $rows->numRows();