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:
parent
8406255305
commit
6a90ec0c90
|
@ -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
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue