catch Index own_id already exists
authorsstamer <s.stamer@metaways.de>
Wed, 11 Nov 2015 13:51:03 +0000 (14:51 +0100)
committerPhilipp Schüle <p.schuele@metaways.de>
Wed, 11 Nov 2015 13:52:27 +0000 (14:52 +0100)
Change-Id: If9c1b451769d7001417a331c858cb5770c622253
Reviewed-on: http://gerrit.tine20.com/customers/2370
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
Tested-by: Philipp Schüle <p.schuele@metaways.de>
tine20/Tinebase/Setup/Update/Release8.php

index 7f298aa..f1441ad 100644 (file)
@@ -508,17 +508,22 @@ class Tinebase_Setup_Update_Release8 extends Setup_Update_Abstract
         $tableVersion = $this->getTableVersion('relations');
 
         if ($tableVersion < 8) {
-            $declaration = new Setup_Backend_Schema_Index_Xml('
-                    <index>
-                        <name>own_id</name>
-                        <field>
+            try {
+                $declaration = new Setup_Backend_Schema_Index_Xml('
+                        <index>
                             <name>own_id</name>
-                        </field>
-                    </index>
-                ');
-
-            $this->_backend->addIndex('relations', $declaration);
-            $this->setTableVersion('relations', '8');
+                            <field>
+                                <name>own_id</name>
+                            </field>
+                        </index>
+                    ');
+    
+                $this->_backend->addIndex('relations', $declaration);
+                $this->setTableVersion('relations', '8');
+            } catch (Zend_Db_Statement_Exception $zdse) {
+                if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ .
+                        ' Index own_id already exists.');
+            }
         }
 
         $this->setApplicationVersion('Tinebase', '8.11');