1
0
Fork 0
mirror of synced 2025-04-01 12:26:11 +03:00

little fix for pgsql sequence handling

This commit is contained in:
zYne 2007-01-29 19:58:00 +00:00
parent 9a45b64391
commit 302405de6d

View file

@ -327,7 +327,12 @@ class Doctrine_Connection_UnitOfWork extends Doctrine_Connection_Module implemen
$this->conn->insert($table->getTableName(), $array);
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) {
$id = $table->getMaxIdentifier();