check column existance first (resubmission_date) in update script
authorPhilipp Schüle <p.schuele@metaways.de>
Mon, 14 Sep 2015 09:15:34 +0000 (11:15 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Thu, 17 Sep 2015 10:21:56 +0000 (12:21 +0200)
Change-Id: I6b30a71c87001653aa9876b92561dfa146eb449f
Reviewed-on: http://gerrit.tine20.com/customers/2194
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
tine20/Crm/Setup/Update/Release8.php

index 4ba8a04..8d73e00 100644 (file)
@@ -17,12 +17,14 @@ class Crm_Setup_Update_Release8 extends Setup_Update_Abstract
      */
     public function update_0()
     {
-        $declaration = new Setup_Backend_Schema_Field_Xml('<field>
-            <name>resubmission_date</name>
-            <type>datetime</type>
-        </field>');
-        
-        $this->_backend->addCol('metacrm_lead', $declaration);
+        if (!$this->_backend->columnExists('resubmission_date', 'metacrm_lead')) {
+            $declaration = new Setup_Backend_Schema_Field_Xml('<field>
+                    <name>resubmission_date</name>
+                    <type>datetime</type>
+                </field>');
+
+            $this->_backend->addCol('metacrm_lead', $declaration);
+        }
 
         $this->setTableVersion('metacrm_lead', 8);