From d2eac08e6baedc265ba5429ac7ac8d3422da5ee6 Mon Sep 17 00:00:00 2001 From: Rachman Chavik Date: Wed, 14 Dec 2011 14:34:41 +0700 Subject: [PATCH] fixing previous incomplete fix --- lib/Cake/Model/Datasource/Database/Postgres.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/Cake/Model/Datasource/Database/Postgres.php b/lib/Cake/Model/Datasource/Database/Postgres.php index e4f3f37dc..b944c2038 100644 --- a/lib/Cake/Model/Datasource/Database/Postgres.php +++ b/lib/Cake/Model/Datasource/Database/Postgres.php @@ -299,8 +299,8 @@ class Postgres extends DboSource { * @return boolean SQL TRUNCATE TABLE statement, false if not applicable. */ public function truncate($table, $reset = false) { - $fullTable = $this->fullTableName($table, false); - if (!isset($this->_sequenceMap[$fullTable])) { + $table = $this->fullTableName($table, false, false); + if (!isset($this->_sequenceMap[$table])) { $cache = $this->cacheSources; $this->cacheSources = false; $this->describe($table); @@ -308,7 +308,6 @@ class Postgres extends DboSource { } if ($this->execute('DELETE FROM ' . $this->fullTableName($table))) { $schema = $this->config['schema']; - $table = $this->fullTableName($table, false, false); if (isset($this->_sequenceMap[$table]) && $reset != true) { foreach ($this->_sequenceMap[$table] as $field => $sequence) { $this->_execute("ALTER SEQUENCE \"{$schema}\".\"{$sequence}\" RESTART WITH 1");