1
0
Fork 0
mirror of https://github.com/Oreolek/kohana-migrations.git synced 2024-06-26 03:40:54 +03:00

Adding mark_migration() method to migration model, allowing the manager to mark a migration as completed

This commit is contained in:
Matt Button 2010-12-30 03:51:20 +00:00
parent 8406255305
commit 6a90ec0c90

View file

@ -112,6 +112,24 @@ class Model_Minion_Migration extends Model
return $this;
}
/**
* Change the applied status for a migration
*
* @param array Migration information
* @param bool Whether this migration has been applied or unapplied
* @return Model_Minion_Migration
*/
public function mark_migration(array $migration, $applied)
{
DB::update($this->_table)
->set(array('applied' => (int) $applied))
->where('timestamp', '=', $migration['timestamp'])
->where('location', '=', $migration['location'])
->execute($this->_db);
return $this;
}
/**
* Selects all migrations from the migratinos table
*