Tinebase_Setup_Update10 - fix order of table structure updates
authorPaul Mehrer <p.mehrer@metaways.de>
Thu, 20 Jul 2017 16:51:30 +0000 (18:51 +0200)
committerPaul Mehrer <p.mehrer@metaways.de>
Thu, 20 Jul 2017 16:52:48 +0000 (18:52 +0200)
Change-Id: I22f8385fb6d2eea96c279fcb696b7ee52be99e05
Reviewed-on: http://gerrit.tine20.com/customers/5276
Reviewed-by: Paul Mehrer <p.mehrer@metaways.de>
Tested-by: Paul Mehrer <p.mehrer@metaways.de>
tine20/Tinebase/Setup/Update/Release10.php

index 00696f8..e485ebe 100644 (file)
@@ -1255,6 +1255,15 @@ class Tinebase_Setup_Update_Release10 extends Setup_Update_Abstract
 
             $this->setTableVersion('tree_nodes', 4);
         }
+
+        if (! $this->_backend->columnExists('pin_protected', 'tree_nodes')) {
+            $this->_backend->addCol('tree_nodes', new Setup_Backend_Schema_Field_Xml('<field>
+                    <name>pin_protected</name>
+                    <type>boolean</type>
+                    <default>false</default>
+                    <notnull>true</notnull>
+                </field>'));
+        }
     }
 
     /**
@@ -1978,13 +1987,7 @@ class Tinebase_Setup_Update_Release10 extends Setup_Update_Abstract
      */
     public function update_38()
     {
-        if (! $this->_backend->columnExists('pin_protected', 'tree_nodes')) {
-            $this->_backend->addCol('tree_nodes', new Setup_Backend_Schema_Field_Xml('<field>
-                    <name>pin_protected</name>
-                    <type>boolean</type>
-                    <default>false</default>
-                    <notnull>true</notnull>
-                </field>'));
+        if ($this->getTableVersion('tree_nodes') < 6) {
             $this->setTableVersion('tree_nodes', 6);
         }
         $this->setApplicationVersion('Tinebase', '10.39');