From ed9b896d228ba5a03841d6de6851f330eb742fd4 Mon Sep 17 00:00:00 2001 From: kasimi Date: Fri, 13 Oct 2017 14:46:32 +0200 Subject: [PATCH] [ticket/15396] Fix revert_schema() steps not executed in correct order PHPBB3-15396 --- phpBB/phpbb/db/migrator.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/phpBB/phpbb/db/migrator.php b/phpBB/phpbb/db/migrator.php index d7d7f18d2b..6c026c3ae1 100644 --- a/phpBB/phpbb/db/migrator.php +++ b/phpBB/phpbb/db/migrator.php @@ -503,11 +503,14 @@ class migrator return; } - foreach ($this->migration_state as $name => $state) + foreach ($this->migrations as $name) { - if (!empty($state['migration_depends_on']) && in_array($migration, $state['migration_depends_on'])) + $state = $this->migration_state($name); + + if ($state && in_array($migration, $state['migration_depends_on']) && ($state['migration_schema_done'] || $state['migration_data_done'])) { $this->revert_do($name); + return; } }