docs/contrib/phinx.md
require 'contrib/phinx.php';
All options are in the config parameter phinx specified as an array (instead of the phinx_path variable).
All parameters are optional, but you can specify them with a dictionary (to change all parameters)
or by deployer dot notation (to change one option).
phinx.environmentphinx.datephinx.configuration N.B. current directory is the project directoryphinx.targetphinx.seedphinx.parserphinx.remove-all (pass empty string as value)phinx_path Specify phinx path (by default phinx is searched for in $PATH, ./vendor/bin and ~/.composer/vendor/bin)$phinx_env_vars = [
'environment' => 'development',
'configuration' => './migration/.phinx.yml',
'target' => '20120103083322',
'remove-all' => '',
];
set('phinx_path', '/usr/local/phinx/bin/phinx');
set('phinx', $phinx_env_vars);
after('cleanup', 'phinx:migrate');
or set it for a specific server
host('dev')
->user('user')
->set('deploy_path', '/var/www')
->set('phinx', $phinx_env_vars)
->set('phinx_path', '');
You can run all tasks before or after any
tasks (but you need to specify external configs for phinx).
If you use internal configs (which are in your project) you need
to run it after the deploy:update_code task is completed.
For further reading see phinx.org. Complete descriptions of all possible options can be found on the commands page.
Phinx recipe for Deployer
@author Alexey Boyko [email protected] @contributor Security-Database [email protected] @copyright 2016 Alexey Boyko @license MIT https://github.com/deployphp/recipes/blob/master/LICENSE
@link https://github.com/deployphp/recipes
@see http://deployer.org @see https://phinx.org
Path to Phinx :::info Autogenerated The value of this configuration is autogenerated on access. :::
Migrats database with phinx.
Rollbacks database migrations with phinx.
Seeds database with phinx.
Sets a migrations breakpoint with phinx.