fix borken update on PGSQL
authorLars Kneschke <l.kneschke@metaways.de>
Fri, 13 Feb 2015 10:32:29 +0000 (11:32 +0100)
committerLars Kneschke <l.kneschke@metaways.de>
Fri, 13 Feb 2015 11:07:22 +0000 (12:07 +0100)
Change-Id: I3796991ef95cb00df316f571d95e0d8d37549fad
Reviewed-on: http://gerrit.tine20.com/customers/1659
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Lars Kneschke <l.kneschke@metaways.de>
tine20/Tinebase/Setup/Update/Release8.php

index 60f2077..2036ace 100644 (file)
@@ -468,21 +468,23 @@ class Tinebase_Setup_Update_Release8 extends Setup_Update_Abstract
      */
     public function update_8()
     {
-        $declaration = new Setup_Backend_Schema_Index_Xml('
-            <index>
-                <name>id</name>
-                <field>
+        $tableVersion = $this->getTableVersion('container_content');
+        
+        if ($tableVersion < 2) {
+            $declaration = new Setup_Backend_Schema_Index_Xml('
+                <index>
                     <name>id</name>
-                </field>
-            </index>
-        ');
-        try {
+                    <field>
+                        <name>id</name>
+                    </field>
+                </index>
+            ');
+            
             $this->_backend->addIndex('container_content', $declaration);
-        } catch (Zend_Db_Statement_Exception $zdse) {
-            Tinebase_Exception::log($zdse);
+            
+            $this->setTableVersion('container_content', '2');
         }
         
-        $this->setTableVersion('container_content', '2');
         $this->setApplicationVersion('Tinebase', '8.9');
     }