X-Git-Url: http://git.cyclocoop.org/%27.%28%24current%20%3E%202?a=blobdiff_plain;f=maintenance%2FdeduplicateArchiveRevId.php;h=a1d4e997fd1c05a9e4ae8c8e1ceaedc1177f8b64;hb=388bbf3f7baefea02f9c89c4ade958059fa4282d;hp=dad79b060d79d28dda74ae7a9ad25696f2705cd8;hpb=8c96aec32cffaab96b2bd9dca206a99a13640545;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/deduplicateArchiveRevId.php b/maintenance/deduplicateArchiveRevId.php index dad79b060d..a1d4e997fd 100644 --- a/maintenance/deduplicateArchiveRevId.php +++ b/maintenance/deduplicateArchiveRevId.php @@ -33,8 +33,14 @@ class DeduplicateArchiveRevId extends LoggedUpdateMaintenance { protected function doDBUpdates() { $this->output( "Deduplicating ar_rev_id...\n" ); - $dbw = $this->getDB( DB_MASTER ); + // Sanity check. If this is a new install, we don't need to do anything here. + if ( PopulateArchiveRevId::isNewInstall( $dbw ) ) { + $this->output( "New install, nothing to do here.\n" ); + return true; + } + + PopulateArchiveRevId::checkMysqlAutoIncrementBug( $dbw ); $minId = $dbw->selectField( 'archive', 'MIN(ar_rev_id)', [], __METHOD__ ); $maxId = $dbw->selectField( 'archive', 'MAX(ar_rev_id)', [], __METHOD__ );