From e2da0b4314229f1e8c7af182f6ec2dda1ae5ef42 Mon Sep 17 00:00:00 2001 From: Nathan Date: Wed, 12 Mar 2014 07:41:10 -0400 Subject: [PATCH] Add --regenerate-all option Bug: 62565 Change-Id: I98e052120c4f64d6a11f8363fa17de9c69656183 --- maintenance/attachLatest.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/maintenance/attachLatest.php b/maintenance/attachLatest.php index 2cf277fe24..1e82dc14c5 100644 --- a/maintenance/attachLatest.php +++ b/maintenance/attachLatest.php @@ -37,15 +37,21 @@ class AttachLatest extends Maintenance { public function __construct() { parent::__construct(); $this->addOption( "fix", "Actually fix the entries, will dry run otherwise" ); + $this->addOption( "regenerate-all", + "Regenerate the page_latest field for all records in table page" ); $this->mDescription = "Fix page_latest entries in the page table"; } public function execute() { $this->output( "Looking for pages with page_latest set to 0...\n" ); $dbw = wfGetDB( DB_MASTER ); + $conds = array( 'page_latest' => 0 ); + if ( $this->hasOption( 'regenerate-all' ) ) { + $conds = ''; + } $result = $dbw->select( 'page', array( 'page_id', 'page_namespace', 'page_title' ), - array( 'page_latest' => 0 ), + $conds, __METHOD__ ); $n = 0; -- 2.20.1