mirror of
https://github.com/Oreolek/kohana-migrations.git
synced 2024-06-26 03:40:54 +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)
|
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);
|
$filename = Minion_Migration_Util::get_filename_from_migration($migration);
|
||||||
|
|
||||||
if ( ! ($file = Kohana::find_file('migrations', $filename, FALSE)))
|
if ( ! ($file = Kohana::find_file('migrations', $filename, FALSE)))
|
||||||
|
|
|
@ -6,4 +6,11 @@ return array(
|
||||||
'group_connection' => 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