Integrates Phinx tool with the Robo task runner.
Add "robertboloc/robo-phinx": "^1.2"
to your composer.json.
{
"require": {
"robertboloc/robo-phinx": "^1.2"
}
}
Execute composer update
Use the Phinx
trait in your RoboFile.php
<?php
class Robofile extends \Robo\Tasks
{
use \Rb\Robo\Task\Phinx;
//...
}
Build your tasks using the Phinx
commands:
<?php
$this->taskPhinx()
->init($path = '.')
->run();
<?php
$this->taskPhinx()
->create($migration)
->run();
<?php
$this->taskPhinx()
->migrate($target = null)
->run();
<?php
$this->taskPhinx()
->rollback($target = null)
->run();
<?php
$this->taskPhinx()
->status()
->run();
You can apply configuration parameters to all the commands using the configuration modifiers:
<?php
$this->taskPhinx()
->config($file = 'phinx.yml')
->status()
->run();
<?php
$this->taskPhinx()
->parser($format = 'yaml')
->status()
->run();
<?php
$this->taskPhinx()
->environment($environment = 'development')
->status()
->run();
Note that all the commands have their default arguments in parenthesis. If no argument is specified the command takes no argument.