little fix for pgsql sequence handling
This commit is contained in:
parent
9a45b64391
commit
302405de6d
1 changed files with 6 additions and 1 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Reference in a new issue