The script can be re-run (in some cases at least!) to fix up incomplete migrations...
authorReedy <reedy@wikimedia.org>
Tue, 17 Apr 2012 15:48:17 +0000 (16:48 +0100)
committerReedy <reedy@wikimedia.org>
Tue, 24 Apr 2012 15:44:00 +0000 (16:44 +0100)
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

maintenance/populateParentId.php

index 14f158c..b6d2067 100644 (file)
@@ -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