mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-17 06:48:59 +08:00
yii migrate/create should not require db component
This commit is contained in:
@@ -115,11 +115,13 @@ class MigrateController extends Controller
|
||||
}
|
||||
$this->migrationPath = $path;
|
||||
|
||||
if (is_string($this->db)) {
|
||||
$this->db = Yii::$app->getComponent($this->db);
|
||||
}
|
||||
if (!$this->db instanceof Connection) {
|
||||
throw new Exception("The 'db' option must refer to the application component ID of a DB connection.");
|
||||
if($action->id!=='create') {
|
||||
if (is_string($this->db)) {
|
||||
$this->db = Yii::$app->getComponent($this->db);
|
||||
}
|
||||
if (!$this->db instanceof Connection) {
|
||||
throw new Exception("The 'db' option must refer to the application component ID of a DB connection.");
|
||||
}
|
||||
}
|
||||
|
||||
$version = Yii::getVersion();
|
||||
|
||||
Reference in New Issue
Block a user