mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Changing Postgresql to use DELETE FROM instead of TRUNCATE.
This should improve compatibilty with databases using constraints. Fixes #1838
This commit is contained in:
parent
ecccfe913b
commit
e1960d1d35
1 changed files with 1 additions and 1 deletions
|
@ -403,7 +403,7 @@ class DboPostgres extends DboSource {
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function truncate($table, $reset = 0) {
|
function truncate($table, $reset = 0) {
|
||||||
if (parent::truncate($table)) {
|
if ($this->execute('DELETE FROM ' . $this->fullTableName($table))) {
|
||||||
$table = $this->fullTableName($table, false);
|
$table = $this->fullTableName($table, false);
|
||||||
if (isset($this->_sequenceMap[$table]) && $reset !== 1) {
|
if (isset($this->_sequenceMap[$table]) && $reset !== 1) {
|
||||||
foreach ($this->_sequenceMap[$table] as $field => $sequence) {
|
foreach ($this->_sequenceMap[$table] as $field => $sequence) {
|
||||||
|
|
Loading…
Reference in a new issue