The idea is to avoid expensive calls to makeDummyRevisionRow, and speed up
installation of MediaWiki on CI.
Bug: T225901
Change-Id: I6f69281568218c89eb18353c06cabf7eb1926de8
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__ );
$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__;
}