jiabin/migraine

Damn simple migrations for PHP

v1.0.0 2014-06-23 22:24 UTC

This package is auto-updated.

Last update: 2024-10-24 00:34:35 UTC


README

Migraine is a PHP-based command-line utility for simplifying the process of creating/executing migrations.

Requirements

The only requirement for Migraine is PHP 5.4+

Install

curl -sS http://jiabin.github.io/migraine/installer | /bin/bash

Quick start

Show all available commands

php migraine.phar

Migrate to the latest version

php migraine.phar migrate

Create a new migration

php migraine.phar create

Print version and exit

php migraine.phar -V

Commands reference

Supported types

  • file
  • mongo
  • redis

Supported bridges

1) Composer

Configuration reference

2) Symfony

Configuration reference

Sample configuration (migraine.yml)

# Migrations will be stored and read from this path
migrations_path:      ./migrations

# Number of "zeros" to append to version
pad_length:           3

# Application bridge
bridge:

    # One of "composer"; "symfony"
    name:                 composer # Required

    # Bridge options
    options:
        autoload: vendor/autoload.php

# Type configuration
types:
    file:
        lock_file:            migraine.lock
    # redis:
    #     host:                 'tcp://localhost:6379'
    #     prefix:               null
    # mongo:
    #     server:               'mongodb://localhost:27017'
    #     database:             migraine

Reporting an issue or a feature request

Issues and feature requests are tracked in the Github issue tracker.

Contributing

First you need to install composer dependencies:

composer install

Now you can run migraine by:

./bin/migraine

To build a phar file you will need box

box build

Then you can launch the app by:

./migraine.phar