Fixes #9465: ./yii migrate/create now generates code based on migration name and --fields

This commit is contained in:
Daniel Gomez Pan
2015-11-20 21:35:58 +03:00
committed by Alexander Makarov
parent 7c9b7c77a7
commit 9afd240ab6
9 changed files with 841 additions and 5 deletions

View File

@ -63,6 +63,16 @@ class MigrateController extends BaseMigrateController
* @inheritdoc
*/
public $templateFile = '@yii/views/migration.php';
/**
* @inheritdoc
*/
public $generatorTemplateFile = [
'create' => '@yii/views/createMigration.php',
'drop' => '@yii/views/dropMigration.php',
'add' => '@yii/views/addColumnMigration.php',
'remove' => '@yii/views/dropColumnMigration.php',
'create_join' => '@yii/views/createJoinMigration.php'
];
/**
* @var Connection|array|string the DB connection object or the application component ID of the DB connection to use
* when applying migrations. Starting from version 2.0.3, this can also be a configuration array