Merge "Add support for 'hu-formal'"
[lhc/web/wiklou.git] / maintenance / populateLogUsertext.php
index 2fe7ea6..3c0bba9 100644 (file)
@@ -50,13 +50,21 @@ class PopulateLogUsertext extends LoggedUpdateMaintenance {
        protected function doDBUpdates() {
                $batchSize = $this->getBatchSize();
                $db = $this->getDB( DB_MASTER );
-               $start = $db->selectField( 'logging', 'MIN(log_id)', false, __METHOD__ );
+               $start = $db->selectField( 'logging', 'MIN(log_id)', '', __METHOD__ );
                if ( !$start ) {
                        $this->output( "Nothing to do.\n" );
 
                        return true;
                }
-               $end = $db->selectField( 'logging', 'MAX(log_id)', false, __METHOD__ );
+               $end = $db->selectField( 'logging', 'MAX(log_id)', '', __METHOD__ );
+
+               // If this is being run during an upgrade from 1.16 or earlier, this
+               // will be run before the actor table change and should continue. But
+               // if it's being run on a new installation, the field won't exist to be populated.
+               if ( !$db->fieldInfo( 'logging', 'log_user_text' ) ) {
+                       $this->output( "No log_user_text field, nothing to do.\n" );
+                       return true;
+               }
 
                # Do remaining chunk
                $end += $batchSize - 1;
@@ -77,7 +85,6 @@ class PopulateLogUsertext extends LoggedUpdateMaintenance {
                        $this->commitTransaction( $db, __METHOD__ );
                        $blockStart += $batchSize;
                        $blockEnd += $batchSize;
-                       wfWaitForSlaves();
                }
                $this->output( "Done populating log_user_text field.\n" );