dev-master
9999999-devYii2 migration assistant
MIT
The Requires
by RUben
yii2 sqlite yii migrate yii2-migrate
Yii2 migration assistant
Migration assistant, (*1)
Console app configuration:, (*2)
return [ ... 'controllerMap' => [ 'migrate' => [ 'class' => 'kubo0\migrate\controllers\MigrateController', 'templateFile' => 'kubo0\migrate\views\MigrationAsArray.php', ], ], ... ];
yii migrate/get-schema
from kubo0\migrate\controllers\MigrateController
generate migration schema for all db tables if not specified., (*3)
When you create a new table, the original way is comfy, but if you have to deal with the development of an existing table migration, the original one can confuse., (*4)
yii migrate/create
generate template from kubo0\migrate\views\MigrationAsArray.php
, (*5)
Modify array to your purpose. Don't use same keys as names in same array. If you need to rename one table and on it's place create other with same name use 'tableName' insted of key;, (*6)
and ./yii migrate/up
or down
will apply and rollback migration., (*7)
tips used from https://yii2-cookbook.readthedocs.org/using-custom-migration-template/, (*8)
If your migration contains comments just add kubo0\migrate\traits\MigrationSqliteCommentTrait
in it, (*9)
Yii2 migration assistant
MIT
yii2 sqlite yii migrate yii2-migrate