X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FpopulateArchiveRevId.php;h=84b962af3719ae49b4fafa6781a65b712e4abd58;hb=7afced64454ad30d688540f7626448ac2faefebb;hp=96fcebf40973fb909d3a88ddd029301124ebdc1b;hpb=b00ce7312209b885ceefe37b710931eef8f8d901;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/populateArchiveRevId.php b/maintenance/populateArchiveRevId.php index 96fcebf409..84b962af37 100644 --- a/maintenance/populateArchiveRevId.php +++ b/maintenance/populateArchiveRevId.php @@ -43,6 +43,15 @@ class PopulateArchiveRevId extends LoggedUpdateMaintenance { $this->setBatchSize( 100 ); } + /** + * @param IDatabase $dbw + * @return bool + */ + public static function isNewInstall( IDatabase $dbw ) { + return $dbw->selectRowCount( 'archive' ) === 0 && + $dbw->selectRowCount( 'revision' ) === 1; + } + protected function getUpdateKey() { return __CLASS__; } @@ -113,7 +122,7 @@ class PopulateArchiveRevId extends LoggedUpdateMaintenance { $dbw->doAtomicSection( __METHOD__, function ( IDatabase $dbw, $fname ) { $dbw->insert( 'revision', self::$dummyRev, $fname ); $id = $dbw->insertId(); - $toDelete[] = $id; + $toDelete = [ $id ]; $maxId = max( (int)$dbw->selectField( 'archive', 'MAX(ar_rev_id)', [], $fname ),