X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=sql%2Falter.sql;h=9d87fc5737f3cdd1edf0379395bf01760a8c5308;hb=60d8961142e146fc12a209727c7c77774303f07a;hp=d1b856aa9c44c96b5ddee095f2145afc5f85fff6;hpb=dc45c23788aef82de242efa67ad47979099b1e97;p=fa-stable.git diff --git a/sql/alter.sql b/sql/alter.sql index d1b856aa..9d87fc57 100644 --- a/sql/alter.sql +++ b/sql/alter.sql @@ -16,6 +16,19 @@ -- ALTER TABLE -- +DROP TABLE IF EXISTS `0_item_units`; +CREATE TABLE IF NOT EXISTS `0_item_units` ( + `abbr` varchar(20) NOT NULL, + `name` varchar(40) NOT NULL, + `decimals` tinyint(2) NOT NULL, + PRIMARY KEY (`abbr`), + UNIQUE KEY `name` (`name`) +) TYPE = MyISAM; + +INSERT INTO `0_item_units` (`abbr`, `name`, `decimals`) SELECT DISTINCT `units`, CONCAT(UPPER(SUBSTRING(`units`, 1, 1)), LOWER(SUBSTRING(`units`, 2))), 0 FROM `0_stock_master` ; +UPDATE `0_debtor_trans` SET `ov_amount`=-`ov_amount`, `ov_gst`=-`ov_gst`, `ov_freight`=-`ov_freight`, `ov_discount`=-`ov_discount` WHERE `ov_amount` < 0 AND `type` <> 10 AND `type` <> 13 ; + +DROP TABLE IF EXISTS `0_form_items`; ALTER TABLE `0_tax_types` DROP INDEX `name`, ADD UNIQUE `name` ( `name` , `rate` ); @@ -28,6 +41,7 @@ ALTER TABLE `0_wo_requirements` CHANGE `workcentre` `workcentre` INT( 11 ) NOT N ALTER TABLE `0_debtor_trans` ADD `version` TINYINT(1) UNSIGNED DEFAULT '0' NOT NULL AFTER `type`; ALTER TABLE `0_sales_orders` ADD `version` TINYINT(1) UNSIGNED DEFAULT '0' NOT NULL AFTER `order_no`; +ALTER TABLE `0_sales_orders` ADD `type` TINYINT(1) NOT NULL DEFAULT '0' AFTER `version`; ALTER TABLE `0_tax_types` DROP `out`; ALTER TABLE `0_debtor_trans_details` ADD COLUMN `qty_done` double NOT NULL default '0';