X-Git-Url: https://git.cyclocoop.org/?a=blobdiff_plain;f=maintenance%2FpopulateBacklinkNamespace.php;h=054f7921fb2b8d6fc73563fb80980f772dd6bda4;hb=d7254e38d5e153a1d5905adaf93cd7d494722eba;hp=271a3f6fd0b5e4d3c3c490637e8fb1eddf753b81;hpb=4c413f2ae7020a0a5a87aa0814b67c2c18d09f35;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/populateBacklinkNamespace.php b/maintenance/populateBacklinkNamespace.php index 271a3f6fd0..054f7921fb 100644 --- a/maintenance/populateBacklinkNamespace.php +++ b/maintenance/populateBacklinkNamespace.php @@ -32,6 +32,7 @@ class PopulateBacklinkNamespace extends LoggedUpdateMaintenance { public function __construct() { parent::__construct(); $this->mDescription = "Populate the *_from_namespace fields"; + $this->addOption( 'lastUpdatedId', "Highest page_id with updated links", false, true ); } protected function getUpdateKey() { @@ -49,7 +50,10 @@ class PopulateBacklinkNamespace extends LoggedUpdateMaintenance { $this->output( "Updating *_from_namespace fields in links tables.\n" ); - $start = $db->selectField( 'page', 'MIN(page_id)', false, __METHOD__ ); + $start = $this->getOption( 'lastUpdatedId' ); + if ( !$start ) { + $start = $db->selectField( 'page', 'MIN(page_id)', false, __METHOD__ ); + } if ( !$start ) { $this->output( "Nothing to do." ); return false;