An open API service indexing awesome lists of open source software.

https://github.com/robertmarsal/robo-phinx

Phinx integration with Robo task runner
https://github.com/robertmarsal/robo-phinx

phinx robo

Last synced: 6 months ago
JSON representation

Phinx integration with Robo task runner

Awesome Lists containing this project

README

          

# Robo Phinx Extension
[![Build Status](https://travis-ci.org/robertboloc/robo-phinx.svg?branch=master)](https://travis-ci.org/robertboloc/robo-phinx)
[![Packagist](https://img.shields.io/packagist/v/robertboloc/robo-phinx.svg?style=flat)](https://packagist.org/packages/robertboloc/robo-phinx)
[![License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat)](https://github.com/robertboloc/robo-phinx/blob/master/LICENSE.md)

Integrates Phinx tool with the [Robo](http://robo.li/) task runner.

## Table of contents
- [Installation](#installation)
- [Usage](#usage)
- [Configuration](#configuration)

## Installation
Add `"robertboloc/robo-phinx": "^1.2"` to your composer.json.
```json
{
"require": {
"robertboloc/robo-phinx": "^1.2"
}
}
```

Execute `composer update`

## Usage

Use the `Phinx` trait in your `RoboFile.php`
```php
taskPhinx()
->init($path = '.')
->run();
```
### Create
```php
taskPhinx()
->create($migration)
->run();
```
### Migrate
```php
taskPhinx()
->migrate($target = null)
->run();
```
### Rollback
```php
taskPhinx()
->rollback($target = null)
->run();
```
### Status
```php
taskPhinx()
->status()
->run();
```

## Configuration

You can apply configuration parameters to all the commands using the configuration modifiers:

### Config
```php
taskPhinx()
->config($file = 'phinx.yml')
->status()
->run();
```

### Parser
```php
taskPhinx()
->parser($format = 'yaml')
->status()
->run();
```

### Environment
```php
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.