1
0
Fork 0
mirror of https://github.com/Oreolek/kohana-migrations.git synced 2024-06-16 15:01:08 +03:00

Add config option to hard prevent migrations before a certain date from running

This commit is contained in:
Jeremy Bush 2011-05-12 14:14:09 -05:00
parent 3e4edb1c0f
commit 64d87e1be9
2 changed files with 16 additions and 0 deletions

View file

@ -132,6 +132,15 @@ class Minion_Migration_Manager {
foreach ($migrations as $migration)
{
if ($method == 'down' AND $migration['timestamp'] <= Kohana::config('minion/migration')->lowest_migration)
{
Minion_CLI::write(
'You\'ve reached the lowest migration allowed by your config: '.Kohana::config('minion/migration')->lowest_migration,
'red'
);
return;
}
$filename = Minion_Migration_Util::get_filename_from_migration($migration);
if ( ! ($file = Kohana::find_file('migrations', $filename, FALSE)))

View file

@ -6,4 +6,11 @@ return array(
'group_connection' => array(
),
/**
* This specifies which migration should be the "base", in timestamp form.
* This migration will not be run when --migrate-down is called
*
* NULL means all migrations will run
*/
'lowest_migration' => NULL,
);