Fixes #8644: Fixed trying to ENABLE/DISABLE TRIGGER ALL on a view in PostgreSQL

This commit is contained in:
Ricardo Pérez
2016-06-19 11:35:41 +02:00
committed by Alexander Makarov
parent 01c84e2ff2
commit 33dfddd0c2
3 changed files with 53 additions and 0 deletions

View File

@@ -190,6 +190,8 @@ class QueryBuilder extends \yii\db\QueryBuilder
$enable = $check ? 'ENABLE' : 'DISABLE';
$schema = $schema ? $schema : $this->db->getSchema()->defaultSchema;
$tableNames = $table ? [$table] : $this->db->getSchema()->getTableNames($schema);
$viewNames = $this->db->getSchema()->getViewNames($schema);
$tableNames = array_diff($tableNames, $viewNames);
$command = '';
foreach ($tableNames as $tableName) {