From 3e4edb1c0f05374a22650dc141fe5103ba83ce0c Mon Sep 17 00:00:00 2001 From: Lorenzo Pisani Date: Wed, 2 Mar 2011 14:30:30 -0700 Subject: [PATCH] fixes #13 (fetch_current_versions fails when there are none that have been applied yet) --- classes/model/minion/migration.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/classes/model/minion/migration.php b/classes/model/minion/migration.php index 29c9ecc..0d505f1 100644 --- a/classes/model/minion/migration.php +++ b/classes/model/minion/migration.php @@ -341,9 +341,10 @@ class Model_Minion_Migration extends Model { $query->where('group', '=', $group); - $statuses = $this->fetch_current_versions(); + $statuses = $this->fetch_current_versions('group', 'timestamp'); + $up = (empty($statuses) OR ($statuses[$group[0]] < $target)); - if ($up = ($statuses[$group[0]] < $target)) + if ($up) { $query->where('timestamp', '<=', $target); }