Commit 302405de authored by zYne's avatar zYne

little fix for pgsql sequence handling

parent 9a45b643
...@@ -327,7 +327,12 @@ class Doctrine_Connection_UnitOfWork extends Doctrine_Connection_Module implemen ...@@ -327,7 +327,12 @@ class Doctrine_Connection_UnitOfWork extends Doctrine_Connection_Module implemen
$this->conn->insert($table->getTableName(), $array); $this->conn->insert($table->getTableName(), $array);
if (empty($seq) && count($keys) == 1 && $keys[0] == $table->getIdentifier()) { if (empty($seq) && count($keys) == 1 && $keys[0] == $table->getIdentifier()) {
$id = $this->conn->sequence->lastInsertId();
if (strtolower($this->conn->getName()) == 'pgsql') {
$seq = $table->getTableName() . '_' . $keys[0] . '_seq';
}
$id = $this->conn->sequence->lastInsertId($seq);
if ( ! $id) { if ( ! $id) {
$id = $table->getMaxIdentifier(); $id = $table->getMaxIdentifier();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment