grundik/yii-migrate
Composer 安装命令:
composer require grundik/yii-migrate
包简介
Simple package to add database migrations to project
README 文档
README
Simple package to add database migrations to project
Installation
-
Add to composer.json:
"require": { "grundik/yii-migrate": "*@dev" }, "repositories": [{ "type": "vcs", "url": "https://github.com/Grundik/yii-migrate.git" }, { "type": "vcs", "url": "https://github.com/yiisoft/yii.git" }] -
Run composer:
composer update
-
Create configuration file:
cp vendor/grundik/yii-migrate/config/migrations.php-default config/migrations.php
-
Edit configuration file to fulfill your needs: set database credentials, migrations path
-
Run
- vendor/bin/migrate - to perform migrate;
- vendor/bin/migrate create - to create new migration.
See also: http://www.yiiframework.com/doc/guide/1.1/en/database.migration
Modules
To use multiple migration folders (e.g. for multiple project modules), define them in migrations.php as explained in example config.
Use parameter --module=<module_name> to perform action in explicit module:
vendor/bin/migrate create migration_name --module=module_name
Migrate without parameters will apply all new migrations from all modules.
Module migrations are applied in order of their creation, regardless of module.
统计信息
- 总下载量: 9.49k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: 0BSD
- 更新时间: 2015-04-23