mirror of
https://github.com/Oreolek/kohana-migrations.git
synced 2024-06-26 03:40:54 +03:00
fixes #13 (fetch_current_versions fails when there are none that have been applied yet)
This commit is contained in:
parent
483d9dac79
commit
3e4edb1c0f
|
@ -341,9 +341,10 @@ class Model_Minion_Migration extends Model
|
||||||
{
|
{
|
||||||
$query->where('group', '=', $group);
|
$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);
|
$query->where('timestamp', '<=', $target);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue