From: Michael M Slusarz Date: Tue, 2 Nov 2010 17:50:36 +0000 (-0600) Subject: Fix autoincrement table generation for postgres X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=c1fa3ccb83b2a0cdef8b4a6e36f5b9ffa3eece28;p=horde.git Fix autoincrement table generation for postgres --- diff --git a/framework/Db/lib/Horde/Db/Adapter/Postgresql/Schema.php b/framework/Db/lib/Horde/Db/Adapter/Postgresql/Schema.php index 4df3e7124..4cc858ae5 100644 --- a/framework/Db/lib/Horde/Db/Adapter/Postgresql/Schema.php +++ b/framework/Db/lib/Horde/Db/Adapter/Postgresql/Schema.php @@ -550,9 +550,9 @@ class Horde_Db_Adapter_Postgresql_Schema extends Horde_Db_Adapter_Base_Schema if ($autoincrement) { $seq_name = $this->defaultSequenceName($tableName, $columnName); - if ($this->table($seq_name)) { + try { $this->execute('DROP SEQUENCE ' . $seq_name . ' CASCADE'); - } + } catch (Horde_Db_Exception $e) {} $this->execute('CREATE SEQUENCE ' . $seq_name); /* Can't use changeColumnDefault() since it quotes the