Commit d62f1b58 by Alexander Makarov

yii migrate/create should not require db component

parent 987b50cf
...@@ -115,11 +115,13 @@ class MigrateController extends Controller ...@@ -115,11 +115,13 @@ class MigrateController extends Controller
} }
$this->migrationPath = $path; $this->migrationPath = $path;
if (is_string($this->db)) { if($action->id!=='create') {
$this->db = Yii::$app->getComponent($this->db); 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 (!$this->db instanceof Connection) {
throw new Exception("The 'db' option must refer to the application component ID of a DB connection.");
}
} }
$version = Yii::getVersion(); $version = Yii::getVersion();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment