|
|
@ -115,12 +115,14 @@ class MigrateController extends Controller |
|
|
|
} |
|
|
|
} |
|
|
|
$this->migrationPath = $path; |
|
|
|
$this->migrationPath = $path; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if($action->id!=='create') { |
|
|
|
if (is_string($this->db)) { |
|
|
|
if (is_string($this->db)) { |
|
|
|
$this->db = Yii::$app->getComponent($this->db); |
|
|
|
$this->db = Yii::$app->getComponent($this->db); |
|
|
|
} |
|
|
|
} |
|
|
|
if (!$this->db instanceof Connection) { |
|
|
|
if (!$this->db instanceof Connection) { |
|
|
|
throw new Exception("The 'db' option must refer to the application component ID of a DB connection."); |
|
|
|
throw new Exception("The 'db' option must refer to the application component ID of a DB connection."); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$version = Yii::getVersion(); |
|
|
|
$version = Yii::getVersion(); |
|
|
|
echo "Yii Migration Tool (based on Yii v{$version})\n\n"; |
|
|
|
echo "Yii Migration Tool (based on Yii v{$version})\n\n"; |
|
|
|