mirror of
https://github.com/Oreolek/kohana-migrations.git
synced 2024-06-28 20:55:08 +03:00
Fixed a bug in the migration model where migrations that hadn't already
been applied would be selected during rollback.
This commit is contained in:
parent
76b0533072
commit
afe039fb4e
|
@ -139,15 +139,16 @@ class Model_Minion_Migration extends Model
|
|||
elseif($timestamp > $current_timestamp)
|
||||
{
|
||||
$query
|
||||
->and_where('timestamp', '>', $current_timestamp)
|
||||
->and_where('timestamp', '<=', $timestamp);
|
||||
->and_where('timestamp', '<=', $timestamp)
|
||||
->and_where('applied', '=', 0);
|
||||
}
|
||||
// If we want to roll back
|
||||
elseif($timestamp < $current_timestamp)
|
||||
{
|
||||
$query
|
||||
->and_where('timestamp', '<', $current_timestamp)
|
||||
->and_where('timestamp', '>=', $timestamp);
|
||||
->and_where('timestamp', '>=', $timestamp)
|
||||
->and_where('applied', '=', 1);
|
||||
}
|
||||
|
||||
foreach($query->execute($this->_db) as $row)
|
||||
|
|
Loading…
Reference in a new issue