robo phinx

Phinx integration with Robo task runner

Robo Phinx Extension

Build Status
Packagist
License

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.