Skip to content
This repository
Browse code

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

in postgres
  • Loading branch information...
commit c00d58b4ef460c066ca5b161a5b2e8b127f5fc2d 1 parent d4631a6
José Lorenzo Rodríguez authored
5  lib/Cake/Model/Datasource/Database/Postgres.php
@@ -287,7 +287,10 @@ public function getSequence($table, $field = 'id') {
287 287
 		if (is_object($table)) {
288 288
 			$table = $this->fullTableName($table, false, false);
289 289
 		}
290  
-		if (isset($this->_sequenceMap[$table]) && isset($this->_sequenceMap[$table][$field])) {
  290
+		if (!isset($this->_sequenceMap[$table])) {
  291
+			$this->describe($table);
  292
+		}
  293
+		if (isset($this->_sequenceMap[$table][$field])) {
291 294
 			return $this->_sequenceMap[$table][$field];
292 295
 		} else {
293 296
 			return "{$table}_{$field}_seq";

0 notes on commit c00d58b

Please sign in to comment.
Something went wrong with that request. Please try again.