yii-migrate
Simple package to add database migrations to project, (*1)
Installation
"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"
}]
, (*2)
composer update
- Create configuration file:
cp vendor/grundik/yii-migrate/config/migrations.php-default config/migrations.php
See also: http://www.yiiframework.com/doc/guide/1.1/en/database.migration, (*5)
Modules
To use multiple migration folders (e.g. for multiple project modules), define them in migrations.php as explained in example config., (*6)
Use parameter --module= to perform action in explicit module:, (*7)
vendor/bin/migrate create migration_name --module=module_name
Migrate without parameters will apply all new migrations from all modules., (*8)
Module migrations are applied in order of their creation, regardless of module., (*9)