From 81a5ab7a6105475292f622c40aa8fe7c414fc930 Mon Sep 17 00:00:00 2001 From: HB9HIL Date: Tue, 25 Jun 2024 13:18:54 +0200 Subject: [PATCH] include the rest aswell to stick with the logic --- system/libraries/Migration.php | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/system/libraries/Migration.php b/system/libraries/Migration.php index 18214e63a..4fa9c14e2 100644 --- a/system/libraries/Migration.php +++ b/system/libraries/Migration.php @@ -324,6 +324,16 @@ class CI_Migration { // After the migrations we can remove the lockfile unlink($this->_migration_lockfile); + // This is necessary when moving down, since the the last migration applied + // will be the down() method for the next migration up from the target + if ($current_version <> $target_version) + { + $current_version = $target_version; + $this->_update_version($current_version); + } + + log_message('debug', 'Finished migrating to '.$current_version); + } else { log_message('error', 'Failed to create Migration Lockfile. Check directory permissions.'); } @@ -332,15 +342,6 @@ class CI_Migration { log_message('debug', 'Migration process is currently locked. Second migration attempt ignored.'); } - // This is necessary when moving down, since the the last migration applied - // will be the down() method for the next migration up from the target - if ($current_version <> $target_version) - { - $current_version = $target_version; - $this->_update_version($current_version); - } - - log_message('debug', 'Finished migrating to '.$current_version); return $current_version; }