1
0
Fork 0
mirror of https://github.com/Oreolek/kohana-migrations.git synced 2024-06-16 15:01:08 +03:00

fixes #13 (fetch_current_versions fails when there are none that have been applied yet)

This commit is contained in:
Lorenzo Pisani 2011-03-02 14:30:30 -07:00
parent 483d9dac79
commit 3e4edb1c0f

View file

@ -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);
}