fixed pgsql import driver
This commit is contained in:
parent
b6e8c40067
commit
7e1c763d5a
@ -88,7 +88,7 @@ class Doctrine_Import_Pgsql extends Doctrine_Import
|
|||||||
WHERE oid IN (
|
WHERE oid IN (
|
||||||
SELECT indexrelid
|
SELECT indexrelid
|
||||||
FROM pg_index, pg_class
|
FROM pg_index, pg_class
|
||||||
WHERE pg_class.relname=%s
|
WHERE pg_class.relname = %s
|
||||||
AND pg_class.oid=pg_index.indrelid
|
AND pg_class.oid=pg_index.indrelid
|
||||||
AND indisunique != 't'
|
AND indisunique != 't'
|
||||||
AND indisprimary != 't'
|
AND indisprimary != 't'
|
||||||
@ -148,8 +148,10 @@ class Doctrine_Import_Pgsql extends Doctrine_Import
|
|||||||
*/
|
*/
|
||||||
public function listTableColumns($table)
|
public function listTableColumns($table)
|
||||||
{
|
{
|
||||||
|
$table = $this->conn->quote($table);
|
||||||
|
$query = sprintf($this->sql['listTableColumns'], $table);
|
||||||
|
$result = $this->conn->fetchAssoc($query);
|
||||||
|
|
||||||
$result = $this->dbh->query($this->sql['listTableColumns'])->fetchAll(PDO::FETCH_ASSOC);
|
|
||||||
$columns = array();
|
$columns = array();
|
||||||
foreach ($result as $key => $val) {
|
foreach ($result as $key => $val) {
|
||||||
if ($val['type'] === 'varchar') {
|
if ($val['type'] === 'varchar') {
|
||||||
@ -190,7 +192,7 @@ class Doctrine_Import_Pgsql extends Doctrine_Import
|
|||||||
*/
|
*/
|
||||||
public function listTables($database = null)
|
public function listTables($database = null)
|
||||||
{
|
{
|
||||||
return $this->dbh->query($this->sql['listTables'])->fetchAll(PDO::FETCH_ASSOC);
|
return $this->conn->fetchAssoc($this->sql['listTables']);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* lists table triggers
|
* lists table triggers
|
||||||
|
Loading…
Reference in New Issue
Block a user