mirror of
https://github.com/Oreolek/kohana-migrations.git
synced 2024-06-26 03:40:54 +03:00
fix migrations in 3.3.x
This commit is contained in:
parent
526e589f3d
commit
09da9b1c0e
|
@ -28,16 +28,16 @@
|
||||||
*
|
*
|
||||||
* @author Matt Button <matthew@sigswitch.com>
|
* @author Matt Button <matthew@sigswitch.com>
|
||||||
*/
|
*/
|
||||||
class Minion_Task_Migrations_New extends Minion_Task
|
class Task_Migrations_New extends Minion_Task
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* A set of config options that this task accepts
|
* A set of config options that this task accepts
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
protected $_options = array(
|
protected $_options = array(
|
||||||
|
'location' => APPPATH,
|
||||||
|
'description' => '',
|
||||||
'group' => NULL,
|
'group' => NULL,
|
||||||
'description' => NULL,
|
|
||||||
'location' => NULL,
|
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -61,14 +61,6 @@ class Minion_Task_Migrations_New extends Minion_Task
|
||||||
|
|
||||||
public function generate($options, $up = null, $down = null)
|
public function generate($options, $up = null, $down = null)
|
||||||
{
|
{
|
||||||
$defaults = array(
|
|
||||||
'location' => APPPATH,
|
|
||||||
'description' => '',
|
|
||||||
'group' => NULL,
|
|
||||||
);
|
|
||||||
|
|
||||||
$options = array_merge($defaults, $options);
|
|
||||||
|
|
||||||
// Trim slashes in group
|
// Trim slashes in group
|
||||||
$options['group'] = trim($options['group'], '/');
|
$options['group'] = trim($options['group'], '/');
|
||||||
|
|
|
@ -44,7 +44,7 @@
|
||||||
*
|
*
|
||||||
* @author Matt Button <matthew@sigswitch.com>
|
* @author Matt Button <matthew@sigswitch.com>
|
||||||
*/
|
*/
|
||||||
class Minion_Task_Migrations_Run extends Minion_Task
|
class Task_Migrations_Run extends Minion_Task
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* A set of config options that this task accepts
|
* A set of config options that this task accepts
|
||||||
|
@ -53,11 +53,11 @@ class Minion_Task_Migrations_Run extends Minion_Task
|
||||||
protected $_options = array(
|
protected $_options = array(
|
||||||
'group' => NULL,
|
'group' => NULL,
|
||||||
'groups' => NULL,
|
'groups' => NULL,
|
||||||
'up' => NULL,
|
|
||||||
'down' => NULL,
|
|
||||||
'to' => NULL,
|
'to' => NULL,
|
||||||
'dry-run' => NULL,
|
'up' => FALSE,
|
||||||
'quiet' => NULL,
|
'down' => FALSE,
|
||||||
|
'dry-run' => FALSE,
|
||||||
|
'quiet' => FALSE,
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -69,13 +69,13 @@ class Minion_Task_Migrations_Run extends Minion_Task
|
||||||
{
|
{
|
||||||
$k_config = Kohana::$config->load('minion/migration');
|
$k_config = Kohana::$config->load('minion/migration');
|
||||||
|
|
||||||
$groups = Arr::get($options, 'group', Arr::get($options, 'groups', NULL));
|
$groups = $options['group'];
|
||||||
$target = Arr::get($options, 'to', NULL);
|
$target = $options['to'];
|
||||||
|
|
||||||
$dry_run = array_key_exists('dry-run', $options);
|
$dry_run = $options['dry-run'] !== FALSE;
|
||||||
$quiet = array_key_exists('quiet', $options);
|
$quiet = $options['quiet'] !== FALSE;
|
||||||
$up = array_key_exists('up', $options);
|
$up = $options['up'] !== FALSE;
|
||||||
$down = array_key_exists('down', $options);
|
$down = $options['down'] !== FALSE;
|
||||||
|
|
||||||
$groups = $this->_parse_groups($groups);
|
$groups = $this->_parse_groups($groups);
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
*
|
*
|
||||||
* @author Matt Button <matthew@sigswitch.com>
|
* @author Matt Button <matthew@sigswitch.com>
|
||||||
*/
|
*/
|
||||||
class Minion_Task_Migrations_Status extends Minion_Task {
|
class Task_Migrations_Status extends Minion_Task {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Execute the task
|
* Execute the task
|
Loading…
Reference in a new issue