diff --git a/framework/yii/db/pgsql/Schema.php b/framework/yii/db/pgsql/Schema.php index bec1803..8cfb535 100644 --- a/framework/yii/db/pgsql/Schema.php +++ b/framework/yii/db/pgsql/Schema.php @@ -73,7 +73,7 @@ class Schema extends \yii\db\Schema ); /** - * Creates a query builder for the MySQL database. + * Creates a query builder for the PostgreSQL database. * @return QueryBuilder query builder instance */ public function createQueryBuilder() @@ -143,14 +143,9 @@ class Schema extends \yii\db\Schema $sql = <<defaultSchema) { + $foreign_table = $constraint['foreign_table_schema'] . '.' . $constraint['foreign_table_name']; + } else { + $foreign_table = $constraint['foreign_table_name']; + } + $citem = array($foreign_table); foreach ($columns as $idx => $column) { $citem[] = array($fcolumns[$idx] => $column); } @@ -243,10 +243,6 @@ ORDER BY SQL; $columns = $this->db->createCommand($sql)->queryAll(); - if (empty($columns)) { - return false; - } - foreach ($columns as $column) { $column = $this->loadColumnSchema($column); $table->columns[$column->name] = $column; @@ -289,4 +285,5 @@ SQL; $column->phpType = $this->getColumnPhpType($column); return $column; } + }