X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=sql%2Falter2.1.sql;h=5d9d7a5baa17d51961803277482bf357a5b1d9b1;hb=14542a514b498def3c48dd27031f2f77fd2db967;hp=8ae7a66c409305b32b7c0fba482af067208ce47c;hpb=37da0ea920fdff712ccef4e1324aa822e981c8fc;p=fa-stable.git diff --git a/sql/alter2.1.sql b/sql/alter2.1.sql index 8ae7a66c..5d9d7a5b 100644 --- a/sql/alter2.1.sql +++ b/sql/alter2.1.sql @@ -1,5 +1,71 @@ +DROP TABLE IF EXISTS `0_bank_trans_types`; + +ALTER TABLE `0_bank_accounts` DROP PRIMARY KEY; +ALTER TABLE `0_bank_accounts` ADD `id` SMALLINT(6) AUTO_INCREMENT PRIMARY KEY; +ALTER TABLE `0_bank_accounts` ADD KEY (`account_code`); + +# Version for any MySQL but usable with digital only gl account codes: +# UPDATE 0_bank_accounts SET id = account_code; +# For any Applicable only to MySQL >=4.0.4 : +UPDATE `0_bank_trans`, `0_bank_accounts` SET 0_bank_trans.bank_act=0_bank_accounts.id + WHERE 0_bank_trans.bank_act=0_bank_accounts.account_code; + + +ALTER TABLE `0_users` ADD `query_size` TINYINT(1) DEFAULT '10'; + +DROP TABLE IF EXISTS `0_sales_pos`; + +CREATE TABLE `0_sales_pos` ( + `id` smallint(6) NOT NULL auto_increment, + `pos_name` varchar(30) NOT NULL, + `cash_sale` tinyint(1) NOT NULL, + `credit_sale` tinyint(1) NOT NULL, + `pos_location` varchar(5) NOT NULL, + `pos_account` varchar(11) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY(`pos_name`) +) TYPE=MyISAM AUTO_INCREMENT=1; + +INSERT INTO `0_sales_pos` VALUES ('1', 'Default', '1', '1', 'DEF', '1'); + +ALTER TABLE `0_users` ADD `pos` SMALLINT(6) DEFAULT '1'; + +DROP TABLE IF EXISTS `0_quick_entries`; + +CREATE TABLE `0_quick_entries` ( + `id` smallint(6) NOT NULL auto_increment, + `description` varchar(60) NOT NULL, + `deposit` tinyint(1) NOT NULL default '0', + `bank_only` tinyint(1) NOT NULL default '0', + PRIMARY KEY (`id`), + KEY `description` (`description`) +) TYPE=MyISAM AUTO_INCREMENT=1; + +INSERT INTO `0_quick_entries` VALUES ('1', 'Maintenance', '0', '1'); +INSERT INTO `0_quick_entries` VALUES ('2', 'Phone', '0', '1'); +INSERT INTO `0_quick_entries` VALUES ('3', 'Cash Sales', '1', '1'); + +DROP TABLE IF EXISTS `0_quick_entry_lines`; + +CREATE TABLE `0_quick_entry_lines` ( + `id` smallint(6) NOT NULL auto_increment, + `qid` smallint(6) NOT NULL, + `account` varchar(11) NOT NULL, + `tax_acc` tinyint(1) NOT NULL default '0', + `pct` tinyint(1) NOT NULL default '0', + `amount` double default NULL default '0', + `dimension_id` int(11) NOT NULL default '0', + `dimension2_id` int(11) NOT NULL default '0', + PRIMARY KEY (`id`), + KEY `qid` (`qid`) +) TYPE=MyISAM AUTO_INCREMENT=1; + +INSERT INTO `0_quick_entry_lines` VALUES ('1', '1', '6600', '1', '0', 0, '0', '0'); +INSERT INTO `0_quick_entry_lines` VALUES ('2', '2', '6730', '1', '0', 0, '0', '0'); +INSERT INTO `0_quick_entry_lines` VALUES ('3', '3', '3000', '1', '0', 0, '0', '0'); ALTER TABLE `0_users` ADD `print_profile` VARCHAR(30) DEFAULT '' AFTER `show_hints` ; +ALTER TABLE `0_users` ADD `rep_popup` TINYINT(1) DEFAULT '1' AFTER `print_profile` ; DROP TABLE IF EXISTS `0_print_profiles`; CREATE TABLE `0_print_profiles` ( @@ -9,7 +75,7 @@ CREATE TABLE `0_print_profiles` ( `printer` tinyint(5) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `profile` (`profile`,`report`) -) ENGINE=MyISAM AUTO_INCREMENT=10; +) TYPE=MyISAM AUTO_INCREMENT=10; INSERT INTO `0_print_profiles` VALUES ('1', 'Out of office', '', '0'); INSERT INTO `0_print_profiles` VALUES ('2', 'Sales Department', '', '0'); @@ -33,7 +99,7 @@ CREATE TABLE `0_printers` ( `timeout` tinyint(3) unsigned NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`) -) ENGINE=MyISAM AUTO_INCREMENT=4; +) TYPE=MyISAM AUTO_INCREMENT=4; INSERT INTO `0_printers` VALUES ('1', 'QL500', 'Label printer', 'QL500', 'server', '127', '20'); INSERT INTO `0_printers` VALUES ('2', 'Samsung', 'Main network printer', 'scx4521F', 'server', '515', '5');