xiaochengfu/yii2-migrate
Composer 安装命令:
composer require xiaochengfu/yii2-migrate
包简介
yii2 database migration
关键字:
README 文档
README
yii2 database migration ,it is easy!
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist xiaochengfu/yii2-migrate "*"
or add
"xiaochengfu/yii2-migrate": "*"
to the require section of your composer.json file.
Usage
Once the extension is installed, simply use it in your code by :
网页端使用:
1.在 backend/config/main.php 添加如下配置
'modules' => [
'migration' => [
'class' => 'xiaochengfu\migrate\Module',
]
],
2.在你的后台访问 http://yourdomain/migration
演示地址: http://yii.phpsy.cn/migration
命令行使用方法:
1.在console/config/main.php 添加如下配置
'controllerMap' => [
'migrate' => [
'class' => 'xiaochengfu\migrate\console\MigrateController',
'useTablePrefix' => true,
'migrationPath' => '@console/migrations',
],
],
2.将迁移文件转存,及备份
php yii migrate/dump
3.还原指定文件
php yii migrate/to m170420_151515_migration.php
统计信息
- 总下载量: 19
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2017-02-25