From 9b19887fcc16a3bce52f2cbe84e98b8200bab23d Mon Sep 17 00:00:00 2001 From: Ahmad Anbar Date: Tue, 1 Apr 2014 01:13:05 +0300 Subject: Fix #2970 --- system/libraries/Migration.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'system/libraries') diff --git a/system/libraries/Migration.php b/system/libraries/Migration.php index b226ee804..009b54fb4 100644 --- a/system/libraries/Migration.php +++ b/system/libraries/Migration.php @@ -186,7 +186,12 @@ class CI_Migration { { // Note: We use strings, so that timestamp versions work on 32-bit systems $current_version = $this->_get_version(); - $target_version = (string) $target_version; + $target_version = (string) $target_version; + + if ($this->_migration_type == 'sequential') + { + $target_version = str_pad($target_version, 3, '0', STR_PAD_LEFT); + } $migrations = $this->find_migrations(); -- cgit v1.2.3-24-g4f1b From 59739019bee552d6fa7e5c2bd5eddd932e44b045 Mon Sep 17 00:00:00 2001 From: Ahmad Anbar Date: Tue, 1 Apr 2014 01:40:37 +0300 Subject: Fixed according to comment. --- system/libraries/Migration.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'system/libraries') diff --git a/system/libraries/Migration.php b/system/libraries/Migration.php index 009b54fb4..71e0c6993 100644 --- a/system/libraries/Migration.php +++ b/system/libraries/Migration.php @@ -185,13 +185,16 @@ class CI_Migration { public function version($target_version) { // Note: We use strings, so that timestamp versions work on 32-bit systems - $current_version = $this->_get_version(); - $target_version = (string) $target_version; + $current_version = $this->_get_version(); - if ($this->_migration_type == 'sequential') + if ($this->_migration_type === 'sequential') { $target_version = str_pad($target_version, 3, '0', STR_PAD_LEFT); } + else + { + $target_version = (string) $target_version; + } $migrations = $this->find_migrations(); -- cgit v1.2.3-24-g4f1b From e2e5c26294cf831daf49b9d6b51db1278c28beb2 Mon Sep 17 00:00:00 2001 From: Ahmad Anbar Date: Tue, 1 Apr 2014 01:54:39 +0300 Subject: Removed tabs. --- system/libraries/Migration.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'system/libraries') diff --git a/system/libraries/Migration.php b/system/libraries/Migration.php index 71e0c6993..bb20c8473 100644 --- a/system/libraries/Migration.php +++ b/system/libraries/Migration.php @@ -185,11 +185,11 @@ class CI_Migration { public function version($target_version) { // Note: We use strings, so that timestamp versions work on 32-bit systems - $current_version = $this->_get_version(); + $current_version = $this->_get_version(); if ($this->_migration_type === 'sequential') { - $target_version = str_pad($target_version, 3, '0', STR_PAD_LEFT); + $target_version = str_pad($target_version, 3, '0', STR_PAD_LEFT); } else { -- cgit v1.2.3-24-g4f1b From b10a6d62c580980e770ce52b484302d8174764e5 Mon Sep 17 00:00:00 2001 From: Ahmad Anbar Date: Tue, 1 Apr 2014 02:00:50 +0300 Subject: Removed tab on empty line too. --- system/libraries/Migration.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/libraries') diff --git a/system/libraries/Migration.php b/system/libraries/Migration.php index bb20c8473..9185adff1 100644 --- a/system/libraries/Migration.php +++ b/system/libraries/Migration.php @@ -186,7 +186,7 @@ class CI_Migration { { // Note: We use strings, so that timestamp versions work on 32-bit systems $current_version = $this->_get_version(); - + if ($this->_migration_type === 'sequential') { $target_version = str_pad($target_version, 3, '0', STR_PAD_LEFT); -- cgit v1.2.3-24-g4f1b