From: Janusz Dobrowolski Date: Thu, 16 Feb 2012 11:25:21 +0000 (+0100) Subject: Fixed 2.4 upgrade routines (column drop moved to post-upgrade cleanup). X-Git-Tag: v2.4.2~19^2~366 X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=3e802cbb66e3b502ae3dcd5b120c429bf1469305;p=fa-stable.git Fixed 2.4 upgrade routines (column drop moved to post-upgrade cleanup). --- diff --git a/sql/alter2.4.php b/sql/alter2.4.php index 898c566a..f48ca015 100644 --- a/sql/alter2.4.php +++ b/sql/alter2.4.php @@ -30,7 +30,9 @@ class fa2_4 { if (get_company_pref('grn_clearing_act') === null) { // available form 2.3.1, can be not defined on pre-2.4 installations set_company_pref('grn_clearing_act', 'glsetup.purchase', 'varchar', 15, 0); } - if ($this->update_workorders()) + $result = $this->update_workorders(); + if ($result) + $result = $this->do_cleanup(); // return update_company_prefs(array('version_id'=>$db_version)); return true; } @@ -83,6 +85,12 @@ class fa2_4 { } return true; } + + function do_cleanup() + { + $sql = "ALTER TABLE `".TB_PREF."tax_group_items` DROP COLUMN `rate`"; + return db_query($sql); + } } $install = new fa2_4; diff --git a/sql/alter2.4.sql b/sql/alter2.4.sql index 2c9f698d..73bbcef5 100644 --- a/sql/alter2.4.sql +++ b/sql/alter2.4.sql @@ -33,7 +33,7 @@ UPDATE `0_tax_group_items` tgi 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_tax_group_items` DROP COLUMN `rate`; + ALTER TABLE `0_sales_order_details` ADD KEY `stkcode` (`stk_code`); ALTER TABLE `0_purch_order_details` ADD KEY `itemcode` (`item_code`); ALTER TABLE `0_sys_prefs` CHANGE `value` `value` TEXT NOT NULL DEFAULT '';