1
0
Fork 0
mirror of https://github.com/Oreolek/kohana-migrations.git synced 2024-06-26 03:40:54 +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:
Matt Button 2010-12-25 03:00:34 +00:00
parent 76b0533072
commit afe039fb4e

View file

@ -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', '<', $current_timestamp)
->and_where('timestamp', '>=', $timestamp)
->and_where('applied', '=', 1);
}
foreach($query->execute($this->_db) as $row)