dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Deprecate additional public methods of Parser
[lhc/web/wiklou.git]
/
maintenance
/
populateArchiveRevId.php
diff --git
a/maintenance/populateArchiveRevId.php
b/maintenance/populateArchiveRevId.php
index
96fcebf
..
84b962a
100644
(file)
--- a/
maintenance/populateArchiveRevId.php
+++ b/
maintenance/populateArchiveRevId.php
@@
-43,6
+43,15
@@
class PopulateArchiveRevId extends LoggedUpdateMaintenance {
$this->setBatchSize( 100 );
}
$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__;
}
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();
$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 ),
$maxId = max(
(int)$dbw->selectField( 'archive', 'MAX(ar_rev_id)', [], $fname ),