X-Git-Url: https://git.cyclocoop.org/%28%28?a=blobdiff_plain;f=maintenance%2FpopulateIpChanges.php;h=fbe16de5418a5bb5264ad4775ad119142d28de77;hb=526341516a91502ac7cfd2e5590e7432b3f50c5d;hp=178c49a73ef7f9c0ac8dc0c9e5748fac1b88dcae;hpb=0cf636a075b1716916979cc6c3bfead9ef960e01;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/populateIpChanges.php b/maintenance/populateIpChanges.php index 178c49a73e..fbe16de541 100644 --- a/maintenance/populateIpChanges.php +++ b/maintenance/populateIpChanges.php @@ -62,9 +62,14 @@ TEXT } public function doDBUpdates() { + $dbw = $this->getDB( DB_MASTER ); + + if ( !$dbw->tableExists( 'ip_changes' ) ) { + $this->fatalError( 'ip_changes table does not exist' ); + } + $lbFactory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory(); $dbr = $this->getDB( DB_REPLICA, [ 'vslow' ] ); - $dbw = $this->getDB( DB_MASTER ); $throttle = intval( $this->getOption( 'throttle', 0 ) ); $maxRevId = intval( $this->getOption( 'max-rev-id', 0 ) ); $start = $this->getOption( 'rev-id', 0 ); @@ -82,7 +87,7 @@ TEXT $rows = $dbr->select( 'revision', [ 'rev_id', 'rev_timestamp', 'rev_user_text' ], - [ "rev_id BETWEEN $blockStart AND $blockEnd", 'rev_user' => 0 ], + [ "rev_id BETWEEN " . (int)$blockStart . " AND " . (int)$blockEnd, 'rev_user' => 0 ], __METHOD__ ); @@ -132,5 +137,5 @@ TEXT } } -$maintClass = "PopulateIpChanges"; +$maintClass = PopulateIpChanges::class; require_once RUN_MAINTENANCE_IF_MAIN;