robertboloc / robo-phinx
Phinx integration with Robo task runner
1.2.0
2018-06-14 19:58 UTC
Requires
- php: >=5.6
Requires (Dev)
- consolidation/robo: ^1.0
- phpunit/phpunit: ^4.4.5
- robmorgan/phinx: ^0.4.6
This package is not auto-updated.
Last update: 2024-10-26 17:45:34 UTC
README
Integrates Phinx tool with the Robo task runner.
Table of contents
Installation
Add "robertboloc/robo-phinx": "^1.2"
to your composer.json.
{ "require": { "robertboloc/robo-phinx": "^1.2" } }
Execute composer update
Usage
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:
Init
<?php $this->taskPhinx() ->init($path = '.') ->run();
Create
<?php $this->taskPhinx() ->create($migration) ->run();
Migrate
<?php $this->taskPhinx() ->migrate($target = null) ->run();
Rollback
<?php $this->taskPhinx() ->rollback($target = null) ->run();
Status
<?php $this->taskPhinx() ->status() ->run();
Configuration
You can apply configuration parameters to all the commands using the configuration modifiers:
Config
<?php $this->taskPhinx() ->config($file = 'phinx.yml') ->status() ->run();
Parser
<?php $this->taskPhinx() ->parser($format = 'yaml') ->status() ->run();
Environment
<?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.