Fixed upgrade procedures (obsolete columns dropped in post_install phase), restored...
authorJanusz Dobrowolski <janusz@frontaccounting.eu>
Fri, 17 Apr 2015 15:54:42 +0000 (17:54 +0200)
committerJanusz Dobrowolski <janusz@frontaccounting.eu>
Fri, 17 Apr 2015 20:04:33 +0000 (22:04 +0200)
sql/alter2.4.php
sql/alter2.4.sql
sql/en_US-new.sql

index 4fd3563f9fc4062e0129eb3493ab1f6e1747340c..768da67b0b523b5c4e289ff3c08ab731c5845eab 100644 (file)
@@ -249,10 +249,11 @@ class fa2_4 extends fa_patch {
                //remove obsolete and temporary columns.
                // this have to be done here as db_import rearranges alter query order
                $dropcol = array(
+                               'tax_groups' => array('tax_shipping'),
                                'tax_group_items' => array('rate'),
                                'budget_trans' => array('type', 'type_no', 'person_id', 'person_type_id', 'memo_'),
                                'cust_branch' => array('contact_name', 'disable_trans'),
-                               'stock_moves' => array('discount_percent',  'person_id'),
+                               'stock_moves' => array('discount_percent', 'visible', 'person_id'),
                );
 
                foreach($dropcol as $table => $columns)
index 3f28cd7b201cfac55ab0b3aee71915f1caae0f98..56aa0199921e65a71d08d8b0ec2c8f0d3723a4d3 100644 (file)
@@ -32,7 +32,6 @@ UPDATE `0_tax_group_items` tgi
        SET tgi.tax_shipping=1
        WHERE tgi.rate=(SELECT 0_tax_types.rate FROM 0_tax_types, 0_tax_groups 
                WHERE tax_shipping=1 AND tgi.tax_group_id=0_tax_groups.id AND tgi.tax_type_id=0_tax_types.id);
-ALTER TABLE `0_tax_groups` DROP COLUMN `tax_shipping`;
 
 ALTER TABLE `0_sales_order_details` ADD KEY `stkcode` (`stk_code`);
 ALTER TABLE `0_purch_order_details` ADD KEY `itemcode` (`item_code`);
@@ -229,7 +228,6 @@ DELETE moves
        INNER JOIN (SELECT * FROM `0_stock_moves` WHERE `type`=11 AND `qty`<0) writeoffs ON writeoffs.`trans_no`=moves.`trans_no` AND writeoffs.`type`=11
        WHERE moves.`type`=11;
 
-ALTER TABLE `0_stock_moves` DROP COLUMN `visible`;
 # stock_moves.discount_percent field are obsolete
 
 UPDATE `0_stock_moves` SET
index 31947a52b602dc8590f82c5c3a7871001516334d..39257f716cb1c57869bdd956836b44897d79e4c7 100644 (file)
@@ -1611,6 +1611,7 @@ CREATE TABLE IF NOT EXISTS `0_stock_master` (
 -- Table structure for table `0_stock_moves`
 --
 
+DROP TABLE IF EXISTS `0_stock_moves`;
 CREATE TABLE `0_stock_moves` (
   `trans_id` int(11) NOT NULL AUTO_INCREMENT,
   `trans_no` int(11) NOT NULL DEFAULT '0',