From 3aa2cc8d91e29b63e7758db9bd1b3416e58f9dad Mon Sep 17 00:00:00 2001 From: tvolf Date: Mon, 4 Jul 2016 10:29:37 +0300 Subject: [PATCH] Fixed rollback process for 2 migrations case --- src/Phinx/Migration/Manager.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Phinx/Migration/Manager.php b/src/Phinx/Migration/Manager.php index 58a4cb936..4148bed09 100644 --- a/src/Phinx/Migration/Manager.php +++ b/src/Phinx/Migration/Manager.php @@ -391,7 +391,7 @@ public function rollback($environment, $version = null, $force = false) if (null === $version) { // Get the migration before the last run migration $prev = count($versions) - 2; - $version = $prev <= 0 ? 0 : $versions[$prev]; + $version = $prev < 0 ? 0 : $versions[$prev]; } else { // Get the first migration number $first = $versions[0];