Permalink
Browse files

Fix for #2247 | Use correct column when calculating next sequence value

See #2247 for more details.
  • Loading branch information...
ZachGambino-GG committed Oct 30, 2013
1 parent 9d87f6f commit 927a4933d1289da33251dd0a8112b9cedbe71ed6
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/Cake/Model/Datasource/Database/Postgres.php
@@ -325,7 +325,7 @@ public function resetSequence($table, $column) {
$fullTable = $this->fullTableName($table);
$sequence = $this->value($this->getSequence($tableName, $column));
$this->execute("SELECT setval($sequence, (SELECT MAX(id) FROM $fullTable))");
$this->execute("SELECT setval($sequence, (SELECT MAX($column) FROM $fullTable))");
return true;
}

0 comments on commit 927a493

Please sign in to comment.