mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 11:06:15 +00:00
fixing previous incomplete fix
This commit is contained in:
parent
cfb6ed4cda
commit
d2eac08e6b
1 changed files with 2 additions and 3 deletions
|
@ -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");
|
||||
|
|
Loading…
Add table
Reference in a new issue