From c1fa3ccb83b2a0cdef8b4a6e36f5b9ffa3eece28 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Tue, 2 Nov 2010 11:50:36 -0600 Subject: [PATCH] Fix autoincrement table generation for postgres --- framework/Db/lib/Horde/Db/Adapter/Postgresql/Schema.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 -- 2.11.0