mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-06 14:19:23 +08:00
Fixes #14864: Ability to use dependencies in constructor of migrations
This commit is contained in:

committed by
Alexander Makarov

parent
7ff12aac42
commit
ab8c54f12a
@ -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,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user