From: Reedy Date: Tue, 17 Apr 2012 15:48:17 +0000 (+0100) Subject: The script can be re-run (in some cases at least!) to fix up incomplete migrations... X-Git-Tag: 1.31.0-rc.0~23805^2 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=fdcac385a203a8073626f41792f32d7dfe603aa3;p=lhc%2Fweb%2Fwiklou.git The script can be re-run (in some cases at least!) to fix up incomplete migrations (see bug 34981 for enwiki) There's little point reading a row from the db if rev_parent_id != null, as the parent id has already been populated. Added this as an extra condition, filtering on this after limiting to a relatively small batch should be ok (rev_parent_id isn't indexed) Change-Id: I85b5813ab214869350c95f3bee58daca3e92eba0 --- diff --git a/maintenance/populateParentId.php b/maintenance/populateParentId.php index 14f158c95d..b6d20671d3 100644 --- a/maintenance/populateParentId.php +++ b/maintenance/populateParentId.php @@ -61,7 +61,7 @@ class PopulateParentId extends LoggedUpdateMaintenance { $cond = "rev_id BETWEEN $blockStart AND $blockEnd"; $res = $db->select( 'revision', array( 'rev_id', 'rev_page', 'rev_timestamp', 'rev_parent_id' ), - $cond, __METHOD__ ); + array( $cond, 'rev_parent_id' => null ), __METHOD__ ); # Go through and update rev_parent_id from these rows. # Assume that the previous revision of the title was # the original previous revision of the title when the