fix update script for Sales application
authorLars Kneschke <l.kneschke@metaways.de>
Tue, 10 Feb 2015 08:13:33 +0000 (09:13 +0100)
committerPhilipp Schüle <p.schuele@metaways.de>
Tue, 10 Feb 2015 12:42:58 +0000 (13:42 +0100)
Change-Id: Iddec41931a27d9b64621c5ac13b4c9a7d1cab4e3
Reviewed-on: http://gerrit.tine20.com/customers/1629
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
Tested-by: Jenkins CI (http://ci.tine20.com/)
tine20/Sales/Setup/Update/Release8.php

index 34ff717..4a1308b 100644 (file)
@@ -270,10 +270,8 @@ class Sales_Setup_Update_Release8 extends Setup_Update_Abstract
     public function update_4()
     {
         $columns = array("sales_contracts" => array(
-                    "title" => "true",
-                    "cleared_in" => "false"
-                    )
-                );
+            "title" => "true"
+        ));
         
         $this->truncateTextColumn($columns, 255);
         $this->setTableVersion('sales_contracts', 6);
@@ -1064,7 +1062,7 @@ class Sales_Setup_Update_Release8 extends Setup_Update_Abstract
             <default>1</default>
         </field>');
         
-        $this->_backend->alterCol('sales_invoice_positions', $declaration, 'quantity');
+        $this->_backend->alterCol('sales_invoice_positions', $declaration);
         
         $this->setTableVersion('sales_invoice_positions', 2);
         $this->setApplicationVersion('Sales', '8.12');
@@ -1462,7 +1460,8 @@ class Sales_Setup_Update_Release8 extends Setup_Update_Abstract
      */
     public function update_20()
     {
-        if (! $this->_backend->columnExists('created_by', 'sales_product_agg')) {
+        // this breaks if the cache is not valid
+        if ($this->_backend->tableVersionQuery('sales_product_agg') != '3') {
             $this->_addModlogToProductAggregates();
         }