X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FpopulateLogUsertext.php;h=3c0bba97c12405083e3fb0c84e8ac57461c1e846;hb=278d80b8a1912918ec1caf2f6d177b03d847e474;hp=6e8261a6125998f8fa1772bc373c268b2de8fce9;hpb=1a40e0cc86b6ee0706606ded3ea243dfde4a414c;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/populateLogUsertext.php b/maintenance/populateLogUsertext.php index 6e8261a612..3c0bba97c1 100644 --- a/maintenance/populateLogUsertext.php +++ b/maintenance/populateLogUsertext.php @@ -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" ); @@ -85,5 +92,5 @@ class PopulateLogUsertext extends LoggedUpdateMaintenance { } } -$maintClass = "PopulateLogUsertext"; +$maintClass = PopulateLogUsertext::class; require_once RUN_MAINTENANCE_IF_MAIN;