2017 © Pedro Peláez
 

library newx-migration

A data migration

image

beansir/newx-migration

A data migration

  • Tuesday, March 13, 2018
  • by 1052049021@qq.com
  • Repository
  • 0 Watchers
  • 1 Stars
  • 7 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

NewX Migration

安装说明

使用composer一键安装, (*1)

composer require beansir/newx-migration

搭建结构

  • migration
    • config
      • config.php
    • tasks
  • migrate // 脚本执行文件

创建脚本执行文件migrate

#!/usr/bin/env php
<?php
defined('PROJECT_PATH') or define('PROJECT_PATH', __DIR__);

require PROJECT_PATH . '/vendor/beansir/newx-migration/migrate';

数据库配置文件

migration/config/database.php, (*2)

<?php
return [
    // 初始化以default数据库配置执行,初始化前请先配置此项
    'default' => [
        'host' => '127.0.0.1',
        'user' => 'root',
        'password' => 'root',
        'db' => 'chat',
        'type' => 'mysqli'
    ]
];

初始化

migrate init

新建迁移

migrate create table_user

迁移方式1:全部迁移

migrate

迁移方式2:指定迁移个数N

migrate N

迁移方式3: 指定第N个迁移

migrate -N

Demo

migrate // 所有未执行的迁移
migrate 3 // 从最近新建迁移的前3个迁移
migrate -2 // 从最近新建迁移的第2个迁移

The Versions

13/03 2018

dev-master

9999999-dev

A data migration

  Sources   Download

MIT

The Requires

 

by bean

migration migrate newx

13/03 2018

v1.2

1.2.0.0

A data migration

  Sources   Download

MIT

The Requires

 

by bean

migration migrate newx

08/03 2018

v1.0

1.0.0.0

A data migration

  Sources   Download

MIT

The Requires

 

by bean

migration migrate newx

08/03 2018

v1.1

1.1.0.0

A data migration

  Sources   Download

MIT

The Requires

 

by bean

migration migrate newx