mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 22:28:51 +00:00
[ticket/14742] Fix schema update
First make it work, then avoid a loop PHPBB3-14742
This commit is contained in:
parent
2ee8bd0c4a
commit
6078bae7f8
1 changed files with 11 additions and 1 deletions
|
@ -470,6 +470,9 @@ class migrator
|
||||||
$steps = array_reverse($steps);
|
$steps = array_reverse($steps);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
end($steps);
|
||||||
|
$last_step_identifier = key($steps);
|
||||||
|
|
||||||
foreach ($steps as $step_identifier => $step)
|
foreach ($steps as $step_identifier => $step)
|
||||||
{
|
{
|
||||||
$last_result = 0;
|
$last_result = 0;
|
||||||
|
@ -486,6 +489,12 @@ class migrator
|
||||||
|
|
||||||
// Set state to false since we reached the point we were at
|
// Set state to false since we reached the point we were at
|
||||||
$state = false;
|
$state = false;
|
||||||
|
|
||||||
|
// There is a programmed tendency to get stuck in this case
|
||||||
|
if (strpos($step[0], 'dbtools') === 0 && ($last_result === null || $last_result === true))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
|
@ -494,7 +503,8 @@ class migrator
|
||||||
// After any schema update step we allow to pause, since
|
// After any schema update step we allow to pause, since
|
||||||
// database changes can take quite some time
|
// database changes can take quite some time
|
||||||
$result = $this->run_step($step, $last_result, $revert);
|
$result = $this->run_step($step, $last_result, $revert);
|
||||||
if ($result !== null && $result !== true && strpos($step[0], 'dbtools') !== 0)
|
if (($result !== null && $result !== true) ||
|
||||||
|
(strpos($step[0], 'dbtools') === 0 && $step_identifier !== $last_step_identifier))
|
||||||
{
|
{
|
||||||
return serialize(array(
|
return serialize(array(
|
||||||
'result' => $result,
|
'result' => $result,
|
||||||
|
|
Loading…
Add table
Reference in a new issue