mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-18 23:43:19 +08:00
Added initial unit testing files for the pgsql driver.
This commit is contained in:
36
framework/yii/db/pgsql/Schema.php
Normal file
36
framework/yii/db/pgsql/Schema.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
/**
|
||||
* @link http://www.yiiframework.com/
|
||||
* @copyright Copyright (c) 2008 Yii Software LLC
|
||||
* @license http://www.yiiframework.com/license/
|
||||
*/
|
||||
|
||||
namespace yii\db\pgsql;
|
||||
|
||||
use yii\db\TableSchema;
|
||||
use yii\db\ColumnSchema;
|
||||
|
||||
/**
|
||||
* Schema is the class for retrieving metadata from a PostgreSQL database (version 9.x and above).
|
||||
*
|
||||
* @author Gevik Babakhani <gevikb@gmail.com>
|
||||
* @since 2.0
|
||||
*/
|
||||
class Schema extends \yii\db\Schema
|
||||
{
|
||||
/**
|
||||
* Loads the metadata for the specified table.
|
||||
* @param string $name table name
|
||||
* @return TableSchema|null driver dependent table metadata. Null if the table does not exist.
|
||||
*/
|
||||
public function loadTableSchema($name)
|
||||
{
|
||||
$table = new TableSchema();
|
||||
$this->resolveTableNames($table, $name);
|
||||
$this->findPrimaryKeys($table);
|
||||
if ($this->findColumns($table)) {
|
||||
$this->findForeignKeys($table);
|
||||
return $table;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user