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:
parent
3e4edb1c0f
commit
64d87e1be9
|
@ -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)))
|
||||
|
|
|
@ -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,
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue