$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__;
}
$ok = false;
while ( !$ok ) {
try {
- $dbw->doAtomicSection( __METHOD__, function ( $dbw, $fname ) {
+ $dbw->doAtomicSection( __METHOD__, function ( IDatabase $dbw, $fname ) {
$dbw->insert( 'revision', self::$dummyRev, $fname );
$id = $dbw->insertId();
$toDelete[] = $id;
self::$dummyRev = self::makeDummyRevisionRow( $dbw );
}
- $updates = $dbw->doAtomicSection( __METHOD__, function ( $dbw, $fname ) use ( $arIds ) {
+ $updates = $dbw->doAtomicSection( __METHOD__, function ( IDatabase $dbw, $fname ) use ( $arIds ) {
// Create new rev_ids by inserting dummy rows into revision and then deleting them.
$dbw->insert( 'revision', array_fill( 0, count( $arIds ), self::$dummyRev ), $fname );
$revIds = $dbw->selectFieldValues(