[ticket/14742] Pause after each schema change

It is certainly better than running them all at once

PHPBB3-14742
This commit is contained in:
Oliver Schramm 2016-08-10 14:32:00 +02:00
parent 2dae36e3fb
commit 9fb649793d
2 changed files with 12 additions and 2 deletions

View file

@ -50,6 +50,7 @@ $lang = array_merge($lang, array(
'MIGRATION_NOT_FULFILLABLE' => 'The migration "%1$s" is not fulfillable, missing migration "%2$s".',
'MIGRATION_NOT_VALID' => '%s is not a valid migration.',
'MIGRATION_SCHEMA_DONE' => 'Installed Schema: %1$s; Time: %2$.2f seconds',
'MIGRATION_SCHEMA_IN_PROGRESS' => 'Installing Schema: %1$s; Time: %2$.2f seconds',
'MIGRATION_SCHEMA_RUNNING' => 'Installing Schema: %s.',
'MIGRATION_INVALID_DATA_MISSING_CONDITION' => 'A migration is invalid. An if statement helper is missing a condition.',

View file

@ -308,7 +308,14 @@ class migrator
$state['migration_data_state'] = ($result === true) ? '' : $result;
$state['migration_schema_done'] = ($result === true);
$this->output_handler->write(array('MIGRATION_SCHEMA_DONE', $name, $elapsed_time), migrator_output_handler_interface::VERBOSITY_NORMAL);
if ($state['migration_schema_done'])
{
$this->output_handler->write(array('MIGRATION_SCHEMA_DONE', $name, $elapsed_time), migrator_output_handler_interface::VERBOSITY_NORMAL);
}
else
{
$this->output_handler->write(array('MIGRATION_SCHEMA_IN_PROGRESS', $name, $elapsed_time), migrator_output_handler_interface::VERBOSITY_VERY_VERBOSE);
}
}
else if (!$state['migration_data_done'])
{
@ -493,8 +500,10 @@ class migrator
try
{
// Result will be null or true if everything completed correctly
// After any schema update step we allow to pause, since
// database changes can take quite some time
$result = $this->run_step($step, $last_result, $revert);
if ($result !== null && $result !== true)
if ($result !== null && $result !== true && strpos($step[0], 'dbtools') !== 0)
{
return serialize(array(
'result' => $result,