1
0
Fork 0
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:
Lorenzo Pisani 2012-10-23 23:45:12 -07:00
parent 526e589f3d
commit 09da9b1c0e
3 changed files with 15 additions and 23 deletions

View file

@ -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'], '/');

View file

@ -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);

View file

@ -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