Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed problems with resetSequence() not using the correct sequence name

in postgres
  • Loading branch information...
commit c00d58b4ef460c066ca5b161a5b2e8b127f5fc2d 1 parent d4631a6
José Lorenzo Rodríguez lorenzo authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 lib/Cake/Model/Datasource/Database/Postgres.php
5 lib/Cake/Model/Datasource/Database/Postgres.php
View
@@ -287,7 +287,10 @@ public function getSequence($table, $field = 'id') {
if (is_object($table)) {
$table = $this->fullTableName($table, false, false);
}
- if (isset($this->_sequenceMap[$table]) && isset($this->_sequenceMap[$table][$field])) {
+ if (!isset($this->_sequenceMap[$table])) {
+ $this->describe($table);
+ }
+ if (isset($this->_sequenceMap[$table][$field])) {
return $this->_sequenceMap[$table][$field];
} else {
return "{$table}_{$field}_seq";
Please sign in to comment.
Something went wrong with that request. Please try again.