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;