From d9022f63880ce039446fba8364f68e656b7bf4cb Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Thu, 3 May 2012 13:01:35 +0200 Subject: Update to MediaWiki 1.19.0 --- maintenance/populateParentId.php | 39 +++++++++++++++++---------------------- 1 file changed, 17 insertions(+), 22 deletions(-) (limited to 'maintenance/populateParentId.php') diff --git a/maintenance/populateParentId.php b/maintenance/populateParentId.php index 7cbc267b..14f158c9 100644 --- a/maintenance/populateParentId.php +++ b/maintenance/populateParentId.php @@ -1,5 +1,5 @@ mDescription = "Populates rev_parent_id"; - $this->setBatchSize( 200 ); } - public function execute() { + protected function getUpdateKey() { + return 'populate rev_parent_id'; + } + + protected function updateSkippedMessage() { + return 'rev_parent_id column of revision table already populated.'; + } + + protected function doDBUpdates() { $db = wfGetDB( DB_MASTER ); if ( !$db->tableExists( 'revision' ) ) { - $this->error( "revision table does not exist", true ); + $this->error( "revision table does not exist" ); + return false; } $this->output( "Populating rev_parent_id column\n" ); $start = $db->selectField( 'revision', 'MIN(rev_id)', false, __FUNCTION__ ); $end = $db->selectField( 'revision', 'MAX(rev_id)', false, __FUNCTION__ ); if ( is_null( $start ) || is_null( $end ) ) { - $this->output( "...revision table seems to be empty.\n" ); - $db->insert( 'updatelog', - array( 'ul_key' => 'populate rev_parent_id' ), - __METHOD__, - 'IGNORE' ); - return; + $this->output( "...revision table seems to be empty, nothing to do.\n" ); + return true; } # Do remaining chunk $blockStart = intval( $start ); @@ -100,17 +104,8 @@ class PopulateParentId extends Maintenance { $blockEnd += $this->mBatchSize; wfWaitForSlaves(); } - $logged = $db->insert( 'updatelog', - array( 'ul_key' => 'populate rev_parent_id' ), - __METHOD__, - 'IGNORE' ); - if ( $logged ) { - $this->output( "rev_parent_id population complete ... {$count} rows [{$changed} changed]\n" ); - return true; - } else { - $this->output( "Could not insert rev_parent_id population row.\n" ); - return false; - } + $this->output( "rev_parent_id population complete ... {$count} rows [{$changed} changed]\n" ); + return true; } } -- cgit v1.2.3-54-g00ecf