jiabin/migraine

PHP的简单迁移工具

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

This package is auto-updated.

Last update: 2024-09-24 00:19:29 UTC


README

Migraine 是一个基于 PHP 的命令行工具,用于简化创建/执行迁移的过程。

要求

Migraine 的唯一要求是 PHP 5.4+

安装

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

快速开始

显示所有可用命令

php migraine.phar

迁移到最新版本

php migraine.phar migrate

创建新的迁移

php migraine.phar create

打印版本并退出

php migraine.phar -V

命令参考

支持类型

  • file
  • mongo
  • redis

支持桥梁

1) Composer

配置参考

2) Symfony

配置参考

示例配置(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

报告问题或功能请求

问题和功能请求在 Github 问题跟踪器 中跟踪。

贡献

首先你需要安装 composer 依赖

composer install

现在你可以通过运行 migraine

./bin/migraine

要构建 phar 文件,你需要 box

box build

然后你可以通过以下方式启动应用程序

./migraine.phar