X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=maintenance%2FpopulateLogSearch.php;h=bb4815168125453798a66f9f0af09d6ebbdab09a;hb=af80076034fb734d652eb043c523c1d8df974e51;hp=979a28a20e6b10c83b2bfaff3480604a35012459;hpb=3844fd9d639ed67cd3519eab2d7db440100cdd26;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/populateLogSearch.php b/maintenance/populateLogSearch.php index 979a28a20e..bb48151681 100644 --- a/maintenance/populateLogSearch.php +++ b/maintenance/populateLogSearch.php @@ -60,13 +60,26 @@ class PopulateLogSearch extends LoggedUpdateMaintenance { return false; } - $start = $db->selectField( 'logging', 'MIN(log_id)', false, __FUNCTION__ ); + $start = $db->selectField( 'logging', 'MIN(log_id)', '', __FUNCTION__ ); if ( !$start ) { $this->output( "Nothing to do.\n" ); return true; } - $end = $db->selectField( 'logging', 'MAX(log_id)', false, __FUNCTION__ ); + $end = $db->selectField( 'logging', 'MAX(log_id)', '', __FUNCTION__ ); + + // This maintenance script is for updating pre-1.16 to 1.16. The target_author_id and + // target_author_ip relations it adds will later be migrated to target_author_actor by + // migrateActors.php. If the schema is already 1.34, we should have nothing to do. + if ( !$db->fieldExists( 'logging', 'log_user' ) ) { + $this->output( + "This does not appear to be an upgrade from MediaWiki pre-1.16 " + . "(logging.log_user does not exist).\n" + ); + $this->output( "Nothing to do.\n" ); + + return true; + } # Do remaining chunk $end += $batchSize - 1; @@ -169,5 +182,5 @@ class PopulateLogSearch extends LoggedUpdateMaintenance { } } -$maintClass = "PopulateLogSearch"; +$maintClass = PopulateLogSearch::class; require_once RUN_MAINTENANCE_IF_MAIN;