Wallogit.com
2017 © Pedro Peláez
Yii2 module for managing migrations
A module for Yii2 framework to create and manage migration files without CLI, (*1)
Two-step installation with composer., (*2)
This instructions assumes that you have composer installed and db configured for your Yii2 application., (*3)
Add yii2-migration-module to the require section of your composer.json file:, (*4)
{
"require": {
"barney-k/yii2-migration-module": "dev-master"
}
}
And run following command to download extension using composer:, (*5)
$ php composer.phar update
OR, (*6)
$ php composer.phar require barney-k/yii2-migration-module "dev-master"
Add migration module to both web config files (or backend config if you're using advanced templating) as follows:, (*7)
...
'modules' => [
...
'migration' => [
'class' => 'barneyk\migration\MigrationModule',
],
...
],
...
You can configure the module by adding additional parameters to the config file after the class key:, (*8)
[]
'@vendor/barney-k/yii2-migration-module/migrations'
'Y.m.d. H:i:s'
'migration'
...
'migration' => [
'class' => 'barneyk\migration\MigrationModule',
'admins' => ['root','admin','johndoe'],
'migrationPath' => '@app/migrations',
'dateFormat' => 'd/m/Y H:i:s',
'migrationTable' => 'my_migrations',
],
...