Answer the question
In order to leave comments, you need to log in
How to catch errors when performing a migration via $this->execute(); yii2?
I want to use raw SQL
public function up()
{
$sql = <<<SQL
CREATE TABLE .....
SQL;
try{
$this->execute($sql);
}catch (\yii\base\Exception $e){
echo $e->getMessage();
return false;
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question