From 3df07729b8018acd764a7a8a08f34f1579c43e5e Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Wed, 16 Mar 2016 21:15:52 +0200 Subject: A small Migrations tweak --- system/libraries/Migration.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'system') diff --git a/system/libraries/Migration.php b/system/libraries/Migration.php index 74bec3d60..316c94ae3 100644 --- a/system/libraries/Migration.php +++ b/system/libraries/Migration.php @@ -219,12 +219,17 @@ class CI_Migration { { $method = 'up'; } - else + elseif ($target_version < $current_version) { $method = 'down'; // We need this so that migrations are applied in reverse order krsort($migrations); } + else + { + // Well, there's nothing to migrate then ... + return TRUE; + } // Validate all available migrations within our target range. // -- cgit v1.2.3-24-g4f1b