mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-16 22:39:52 +08:00
more robust check for table not exists
should work on HHVM too
This commit is contained in:
@@ -188,7 +188,7 @@ class Schema extends \yii\db\Schema
|
||||
$columns = $this->db->createCommand($sql)->queryAll();
|
||||
} catch (\Exception $e) {
|
||||
$previous = $e->getPrevious();
|
||||
if ($previous instanceof \PDOException && $previous->getCode() == '42S02') {
|
||||
if ($previous instanceof \PDOException && strpos($previous->getMessage(), 'SQLSTATE[42S02') !== false) {
|
||||
// table does not exist
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user