Fixes #14864: Ability to use dependencies in constructor of migrations

This commit is contained in:
Vitaly
2017-09-23 02:24:18 +03:00
committed by Alexander Makarov
parent 7ff12aac42
commit ab8c54f12a
3 changed files with 12 additions and 3 deletions

View File

@ -185,7 +185,12 @@ class MigrateController extends BaseMigrateController
protected function createMigration($class)
{
$this->includeMigrationFile($class);
return new $class(['db' => $this->db, 'compact' => $this->compact]);
return Yii::createObject([
'class' => $class,
'db' => $this->db,
'compact' => $this->compact,
]);
}
/**