Merged changes from main trunk up to 2.2.5
[fa-stable.git] / sql / en_US-new.sql
index 1be4f088674e419694924e984b260876adc85b04..d107e9ba6f096e0172d994380107b6fd4c0021b0 100644 (file)
@@ -58,7 +58,8 @@ CREATE TABLE `0_audit_trail` (
   `gl_date` date NOT NULL default '0000-00-00',
   `gl_seq` int(11) unsigned default NULL,
    PRIMARY KEY (`id`),
-  KEY (`fiscal_year`, `gl_seq`)
+  KEY `Seq` (`fiscal_year`, `gl_date`, `gl_seq`),
+  KEY `Type_and_Number` (`type`,`trans_no`)
 ) TYPE=InnoDB  ;
 
 ### Data of table `0_audit_trail` ###
@@ -84,7 +85,8 @@ CREATE TABLE `0_bank_accounts` (
   `inactive` tinyint(1) NOT NULL default '0',
   PRIMARY KEY  (`id`),
   KEY `bank_account_name` (`bank_account_name`),
-  KEY `bank_account_number` (`bank_account_number`)
+  KEY `bank_account_number` (`bank_account_number`),
+  KEY (`account_code`)
 ) TYPE=MyISAM AUTO_INCREMENT=3 ;
 
 
@@ -113,7 +115,9 @@ CREATE TABLE `0_bank_trans` (
   `reconciled` date default NULL,
   PRIMARY KEY  (`id`),
   KEY `bank_act` (`bank_act`,`ref`),
-  KEY `type` (`type`,`trans_no`)
+  KEY `type` (`type`,`trans_no`),
+  KEY (`bank_act`,`reconciled`),
+  KEY (`bank_act`,`trans_date`)
 ) TYPE=InnoDB  AUTO_INCREMENT=1 ;
 
 
@@ -137,7 +141,6 @@ CREATE TABLE `0_bom` (
   KEY `id` (`id`),
   KEY `loc_code` (`loc_code`),
   KEY `parent` (`parent`,`loc_code`),
-  KEY `Parent_2` (`parent`),
   KEY `workcentre_added` (`workcentre_added`)
 ) TYPE=MyISAM  AUTO_INCREMENT=1 ;
 
@@ -163,7 +166,8 @@ CREATE TABLE `0_budget_trans` (
   `person_type_id` int(11) default NULL,
   `person_id` tinyblob,
   PRIMARY KEY  (`counter`),
-  KEY `Type_and_Number` (`type`,`type_no`)
+  KEY `Type_and_Number` (`type`,`type_no`),
+  KEY `Account` (`account`, `tran_date`, `dimension_id`, `dimension2_id`)
 ) TYPE=InnoDB  AUTO_INCREMENT=1 ;
 
 
@@ -202,8 +206,8 @@ CREATE TABLE `0_chart_master` (
   `account_type` int(11) NOT NULL default '0',
   `inactive` tinyint(1) NOT NULL default '0',
   PRIMARY KEY  (`account_code`),
-  KEY `account_code` (`account_code`),
-  KEY `account_name` (`account_name`)
+  KEY `account_name` (`account_name`),
+  KEY `accounts_by_type` (`account_type`, `account_code`)
 ) TYPE=MyISAM  ;
 
 
@@ -227,6 +231,7 @@ INSERT INTO `0_chart_master` VALUES ('2110', '', 'Accrued Income Tax - Federal',
 INSERT INTO `0_chart_master` VALUES ('2120', '', 'Accrued Income Tax - State', '4', '0');
 INSERT INTO `0_chart_master` VALUES ('2130', '', 'Accrued Franchise Tax', '4', '0');
 INSERT INTO `0_chart_master` VALUES ('2140', '', 'Accrued Real & Personal Prop Tax', '4', '0');
+INSERT INTO `0_chart_master` VALUES ('2145', '', 'Purchase Tax', '4', '0');
 INSERT INTO `0_chart_master` VALUES ('2150', '', 'Sales Tax', '4', '0');
 INSERT INTO `0_chart_master` VALUES ('2160', '', 'Accrued Use Tax Payable', '4', '0');
 INSERT INTO `0_chart_master` VALUES ('2210', '', 'Accrued Wages', '4', '0');
@@ -300,6 +305,7 @@ CREATE TABLE `0_chart_types` (
   `parent` int(11) NOT NULL default '-1',
   `inactive` tinyint(1) NOT NULL default '0',
   PRIMARY KEY  (`id`),
+  KEY  (`class_id`),
   KEY `name` (`name`)
 ) TYPE=MyISAM AUTO_INCREMENT=13 ;
 
@@ -397,7 +403,6 @@ CREATE TABLE `0_company` (
   PRIMARY KEY  (`coy_code`)
 ) TYPE=MyISAM  ;
 
-
 ### Data of table `0_company` ###
 
 INSERT INTO `0_company` VALUES ('1', 'Company name', '', '', '1', '1', 'N/A', '', '', '', '', '', 'USD', '1200', '5060', '2100', '5690', '4450', '9990', '3590', '4430', '4010', '4510', '4500', '1510', '5010', '5040', '4010', '1530', '5000', '0', '10', '10', '1000', '20', '20', '30', '1', '1', '0', '0', '0', '1', '0', '0', '', '1', '2.2', '0', '-1', '1', '600');
@@ -458,7 +463,9 @@ CREATE TABLE `0_cust_allocations` (
   `trans_type_from` int(11) default NULL,
   `trans_no_to` int(11) default NULL,
   `trans_type_to` int(11) default NULL,
-  PRIMARY KEY  (`id`)
+  PRIMARY KEY  (`id`),
+  KEY `From` (`trans_type_from`, `trans_no_from`),
+  KEY `To` (`trans_type_to`, `trans_no_to`)
 ) TYPE=InnoDB  AUTO_INCREMENT=1 ;
 
 
@@ -497,7 +504,8 @@ CREATE TABLE `0_cust_branch` (
   `inactive` tinyint(1) NOT NULL default '0',
   PRIMARY KEY  (`branch_code`,`debtor_no`),
   KEY `branch_code` (`branch_code`),
-  KEY `br_name` (`br_name`)
+  KEY (`branch_ref`),
+  KEY (`group_no`)
 ) TYPE=MyISAM  AUTO_INCREMENT=1 ;
 
 
@@ -531,8 +539,10 @@ CREATE TABLE `0_debtor_trans` (
   `trans_link` int(11) NOT NULL default '0',
   `dimension_id` int(11) NOT NULL default '0',
   `dimension2_id` int(11) NOT NULL default '0',
-  PRIMARY KEY  (`trans_no`,`type`),
-  KEY `debtor_no` (`debtor_no`,`branch_code`)
+  `payment_terms` int(11) default NULL,
+  PRIMARY KEY  (`type`, `trans_no`),
+  KEY `debtor_no` (`debtor_no`,`branch_code`),
+  KEY (`tran_date`)
 ) TYPE=InnoDB  ;
 
 
@@ -556,7 +566,8 @@ CREATE TABLE `0_debtor_trans_details` (
   `discount_percent` double NOT NULL default '0',
   `standard_cost` double NOT NULL default '0',
   `qty_done` double NOT NULL default '0',
-  PRIMARY KEY  (`id`)
+  PRIMARY KEY  (`id`),
+  KEY `Transaction` (`debtor_trans_type`, `debtor_trans_no`)
 ) TYPE=InnoDB  AUTO_INCREMENT=1 ;
 
 
@@ -587,7 +598,8 @@ CREATE TABLE `0_debtors_master` (
   `notes` tinytext NOT NULL,
   `inactive` tinyint(1) NOT NULL default '0',
   PRIMARY KEY  (`debtor_no`),
-  UNIQUE KEY `name` (`name`)
+  UNIQUE KEY `name` (`name`),
+  KEY (`debtor_ref`)
 ) TYPE=MyISAM  AUTO_INCREMENT=1 ;
 
 
@@ -608,7 +620,10 @@ CREATE TABLE `0_dimensions` (
   `date_` date NOT NULL default '0000-00-00',
   `due_date` date NOT NULL default '0000-00-00',
   PRIMARY KEY  (`id`),
-  UNIQUE KEY `reference` (`reference`)
+  UNIQUE KEY `reference` (`reference`),
+  KEY (`date_`),
+  KEY (`due_date`),
+  KEY (`type_`)
 ) TYPE=InnoDB  AUTO_INCREMENT=1 ;
 
 
@@ -644,7 +659,9 @@ CREATE TABLE `0_fiscal_year` (
   `begin` date default '0000-00-00',
   `end` date default '0000-00-00',
   `closed` tinyint(1) NOT NULL default '0',
-  PRIMARY KEY  (`id`)
+  PRIMARY KEY  (`id`),
+  UNIQUE KEY(`begin`),
+  UNIQUE KEY(`end`)
 ) TYPE=InnoDB AUTO_INCREMENT=2 ;
 
 
@@ -670,7 +687,11 @@ CREATE TABLE `0_gl_trans` (
   `person_type_id` int(11) default NULL,
   `person_id` tinyblob,
   PRIMARY KEY  (`counter`),
-  KEY `Type_and_Number` (`type`,`type_no`)
+  KEY `Type_and_Number` (`type`,`type_no`),
+  KEY (`dimension_id`),
+  KEY (`dimension2_id`),
+  KEY (`tran_date`),
+  KEY `account_and_tran_date` (`account`,`tran_date`)
 ) TYPE=InnoDB  AUTO_INCREMENT=1 ;
 
 
@@ -689,7 +710,9 @@ CREATE TABLE `0_grn_batch` (
   `reference` varchar(60) NOT NULL default '',
   `delivery_date` date NOT NULL default '0000-00-00',
   `loc_code` varchar(5) default NULL,
-  PRIMARY KEY  (`id`)
+  PRIMARY KEY  (`id`),
+  KEY(`delivery_date`),
+  KEY(`purch_order_no`)
 ) TYPE=InnoDB  AUTO_INCREMENT=1 ;
 
 
@@ -709,7 +732,8 @@ CREATE TABLE `0_grn_items` (
   `description` tinytext,
   `qty_recd` double NOT NULL default '0',
   `quantity_inv` double NOT NULL default '0',
-  PRIMARY KEY  (`id`)
+  PRIMARY KEY  (`id`),
+  KEY (`grn_batch_id`)
 ) TYPE=InnoDB  AUTO_INCREMENT=1 ;
 
 
@@ -751,7 +775,8 @@ CREATE TABLE `0_item_codes` (
   `is_foreign` tinyint(1) NOT NULL default '0',
   `inactive` tinyint(1) NOT NULL default '0',
   PRIMARY KEY  (`id`),
-  UNIQUE KEY `stock_id` (`stock_id`,`item_code`)
+  UNIQUE KEY `stock_id` (`stock_id`,`item_code`),
+  KEY (`item_code`)
 ) TYPE=MyISAM  AUTO_INCREMENT=1 ;
 
 
@@ -998,7 +1023,8 @@ CREATE TABLE `0_purch_order_details` (
   `std_cost_unit` double NOT NULL default '0',
   `quantity_ordered` double NOT NULL default '0',
   `quantity_received` double NOT NULL default '0',
-  PRIMARY KEY  (`po_detail_item`)
+  PRIMARY KEY  (`po_detail_item`),
+  KEY `order` (`order_no`, `po_detail_item`)
 ) TYPE=InnoDB  AUTO_INCREMENT=1 ;
 
 
@@ -1019,7 +1045,8 @@ CREATE TABLE `0_purch_orders` (
   `requisition_no` tinytext,
   `into_stock_location` varchar(5) NOT NULL default '',
   `delivery_address` tinytext NOT NULL,
-  PRIMARY KEY  (`order_no`)
+  PRIMARY KEY  (`order_no`),
+  KEY (`ord_date`)
 ) TYPE=InnoDB  AUTO_INCREMENT=1 ;
 
 
@@ -1037,6 +1064,7 @@ CREATE TABLE `0_quick_entries` (
   `description` varchar(60) NOT NULL,
   `base_amount` double NOT NULL default '0',
   `base_desc` varchar(60) default NULL,
+  `bal_type` tinyint(1) NOT NULL default '0',
   PRIMARY KEY  (`id`),
   KEY `description` (`description`)
 ) TYPE=MyISAM AUTO_INCREMENT=4 ;
@@ -1044,9 +1072,9 @@ CREATE TABLE `0_quick_entries` (
 
 ### Data of table `0_quick_entries` ###
 
-INSERT INTO `0_quick_entries` VALUES ('1', '1', 'Maintenance', '0', 'Amount');
-INSERT INTO `0_quick_entries` VALUES ('2', '4', 'Phone', '0', 'Amount');
-INSERT INTO `0_quick_entries` VALUES ('3', '2', 'Cash Sales', '0', 'Amount');
+INSERT INTO `0_quick_entries` VALUES ('1', '1', 'Maintenance', '0', 'Amount', '0');
+INSERT INTO `0_quick_entries` VALUES ('2', '4', 'Phone', '0', 'Amount', '0');
+INSERT INTO `0_quick_entries` VALUES ('3', '2', 'Cash Sales', '0', 'Amount', '0');
 
 
 ### Structure of table `0_quick_entry_lines` ###
@@ -1108,7 +1136,8 @@ CREATE TABLE `0_refs` (
   `id` int(11) NOT NULL default '0',
   `type` int(11) NOT NULL default '0',
   `reference` varchar(100) NOT NULL default '',
-  PRIMARY KEY  (`id`,`type`)
+  PRIMARY KEY  (`id`,`type`),
+  KEY `Type_and_Reference` (`type`,`reference`)
 ) TYPE=InnoDB  ;
 
 
@@ -1130,7 +1159,8 @@ CREATE TABLE `0_sales_order_details` (
   `unit_price` double NOT NULL default '0',
   `quantity` double NOT NULL default '0',
   `discount_percent` double NOT NULL default '0',
-  PRIMARY KEY  (`id`)
+  PRIMARY KEY  (`id`),
+  KEY `sorder` (`trans_type`, `order_no`)
 ) TYPE=InnoDB  AUTO_INCREMENT=1 ;
 
 
@@ -1162,6 +1192,7 @@ CREATE TABLE `0_sales_orders` (
   `freight_cost` double NOT NULL default '0',
   `from_stk_loc` varchar(5) NOT NULL default '',
   `delivery_date` date NOT NULL default '0000-00-00',
+  `payment_terms` int(11) default NULL,
   PRIMARY KEY  (`trans_type`, `order_no`)
 ) TYPE=InnoDB;
 
@@ -1311,7 +1342,7 @@ DROP TABLE IF EXISTS `0_stock_category`;
 CREATE TABLE `0_stock_category` (
   `category_id` int(11) NOT NULL auto_increment,
   `description` varchar(60) NOT NULL default '',
-  `dflt_tax_type` int(11) NOT NULL default '0',
+  `dflt_tax_type` int(11) NOT NULL default '1',
   `dflt_units` varchar(20) NOT NULL default 'each',
   `dflt_mb_flag` char(1) NOT NULL default 'B',
   `dflt_sales_act` varchar(11) NOT NULL default '',
@@ -1362,6 +1393,7 @@ CREATE TABLE `0_stock_master` (
   `overhead_cost` double NOT NULL default '0',
   `inactive` tinyint(1) NOT NULL default '0',
   `no_sale` tinyint(1) NOT NULL default '0',
+  `editable` tinyint(1) NOT NULL default '0',
   PRIMARY KEY  (`stock_id`)
 ) TYPE=InnoDB  ;
 
@@ -1389,7 +1421,8 @@ CREATE TABLE `0_stock_moves` (
   `standard_cost` double NOT NULL default '0',
   `visible` tinyint(1) NOT NULL default '1',
   PRIMARY KEY  (`trans_id`),
-  KEY `type` (`type`,`trans_no`)
+  KEY `type` (`type`,`trans_no`),
+  KEY `Move` (`stock_id`,`loc_code`, `tran_date`)
 ) TYPE=InnoDB  AUTO_INCREMENT=1 ;
 
 
@@ -1409,7 +1442,9 @@ CREATE TABLE `0_supp_allocations` (
   `trans_type_from` int(11) default NULL,
   `trans_no_to` int(11) default NULL,
   `trans_type_to` int(11) default NULL,
-  PRIMARY KEY  (`id`)
+  PRIMARY KEY  (`id`),
+  KEY `From` (`trans_type_from`, `trans_no_from`),
+  KEY `To` (`trans_type_to`, `trans_no_to`)
 ) TYPE=InnoDB  AUTO_INCREMENT=1 ;
 
 
@@ -1434,7 +1469,8 @@ CREATE TABLE `0_supp_invoice_items` (
   `unit_price` double NOT NULL default '0',
   `unit_tax` double NOT NULL default '0',
   `memo_` tinytext,
-  PRIMARY KEY  (`id`)
+  PRIMARY KEY  (`id`),
+  KEY `Transaction` (`supp_trans_type`, `supp_trans_no`, `stock_id`)
 ) TYPE=InnoDB  AUTO_INCREMENT=1 ;
 
 
@@ -1459,10 +1495,11 @@ CREATE TABLE `0_supp_trans` (
   `ov_gst` double NOT NULL default '0',
   `rate` double NOT NULL default '1',
   `alloc` double NOT NULL default '0',
-  PRIMARY KEY  (`trans_no`,`type`),
+  PRIMARY KEY  (`type`, `trans_no`),
   KEY `supplier_id` (`supplier_id`),
   KEY `SupplierID_2` (`supplier_id`,`supp_reference`),
-  KEY `type` (`type`)
+  KEY `type` (`type`),
+  KEY (`tran_date`)
 ) TYPE=InnoDB  ;
 
 
@@ -1500,13 +1537,81 @@ CREATE TABLE `0_suppliers` (
   `payment_discount_account` varchar(11) default NULL,
   `notes` tinytext NOT NULL,
   `inactive` tinyint(1) NOT NULL default '0',
-  PRIMARY KEY  (`supplier_id`)
+  PRIMARY KEY  (`supplier_id`),
+  KEY (`supp_ref`)
 ) TYPE=MyISAM  AUTO_INCREMENT=1 ;
 
 
 ### Data of table `0_suppliers` ###
 
 
+### Structure of table `0_sys_prefs` ###
+
+DROP TABLE IF EXISTS `0_sys_prefs`;
+
+CREATE TABLE `0_sys_prefs` (
+  `name` varchar(35) NOT NULL default '',
+  `category` varchar(30) default NULL,
+  `type` varchar(20) NOT NULL default 'varchar',
+  `length` smallint(6) default NULL,
+  `value` tinytext,
+  PRIMARY KEY  (`name`),
+  KEY `category` (`category`)
+) TYPE=MyISAM;
+
+
+### Data of table `0_sys_prefs` ###
+
+INSERT INTO `0_sys_prefs` VALUES ('coy_name', 'setup.company', 'varchar', '60', 'Company name');
+INSERT INTO `0_sys_prefs` VALUES ('gst_no', 'setup.company', 'varchar', '25', NULL);
+INSERT INTO `0_sys_prefs` VALUES ('coy_no', 'setup.company', 'varchar', '25', NULL);
+INSERT INTO `0_sys_prefs` VALUES ('tax_prd', 'setup.company', 'int', '11', '1');
+INSERT INTO `0_sys_prefs` VALUES ('tax_last', 'setup.company', 'int', '11', '1');
+INSERT INTO `0_sys_prefs` VALUES ('postal_address', 'setup.company', 'tinytext', '0', 'N/A');
+INSERT INTO `0_sys_prefs` VALUES ('phone', 'setup.company', 'varchar', '30', NULL);
+INSERT INTO `0_sys_prefs` VALUES ('fax', 'setup.company', 'varchar', '30', NULL);
+INSERT INTO `0_sys_prefs` VALUES ('email', 'setup.company', 'varchar', '100', NULL);
+INSERT INTO `0_sys_prefs` VALUES ('coy_logo', 'setup.company', 'varchar', '100', NULL);
+INSERT INTO `0_sys_prefs` VALUES ('domicile', 'setup.company', 'varchar', '55', NULL);
+INSERT INTO `0_sys_prefs` VALUES ('curr_default', 'setup.company', 'char', '3', 'USD');
+INSERT INTO `0_sys_prefs` VALUES ('use_dimension', 'setup.company', 'tinyint', '1', '1');
+INSERT INTO `0_sys_prefs` VALUES ('f_year', 'setup.company', 'int', '11', '1');
+INSERT INTO `0_sys_prefs` VALUES ('no_item_list', 'setup.company', 'tinyint', '1', '0');
+INSERT INTO `0_sys_prefs` VALUES ('no_customer_list', 'setup.company', 'tinyint', '1', '0');
+INSERT INTO `0_sys_prefs` VALUES ('no_supplier_list', 'setup.company', 'tinyint', '1', '0');
+INSERT INTO `0_sys_prefs` VALUES ('base_sales', 'setup.company', 'int', '11', '1');
+INSERT INTO `0_sys_prefs` VALUES ('time_zone', 'setup.company', 'tinyint', '1', '0');
+INSERT INTO `0_sys_prefs` VALUES ('add_pct', 'setup.company', 'int', '5', '-1');
+INSERT INTO `0_sys_prefs` VALUES ('round_to', 'setup.company', 'int', '5', '1');
+INSERT INTO `0_sys_prefs` VALUES ('login_tout', 'setup.company', 'smallint', '6', '600');
+INSERT INTO `0_sys_prefs` VALUES ('past_due_days', 'glsetup.general', 'int', '11', '30');
+INSERT INTO `0_sys_prefs` VALUES ('profit_loss_year_act', 'glsetup.general', 'varchar', '11', '9990');
+INSERT INTO `0_sys_prefs` VALUES ('retained_earnings_act', 'glsetup.general', 'varchar', '11', '3590');
+INSERT INTO `0_sys_prefs` VALUES ('bank_charge_act', 'glsetup.general', 'varchar', '11', '5690');
+INSERT INTO `0_sys_prefs` VALUES ('exchange_diff_act', 'glsetup.general', 'varchar', '11', '4450');
+INSERT INTO `0_sys_prefs` VALUES ('default_credit_limit', 'glsetup.customer', 'int', '11', '1000');
+INSERT INTO `0_sys_prefs` VALUES ('accumulate_shipping', 'glsetup.customer', 'tinyint', '1', '0');
+INSERT INTO `0_sys_prefs` VALUES ('legal_text', 'glsetup.customer', 'tinytext', '0', NULL);
+INSERT INTO `0_sys_prefs` VALUES ('freight_act', 'glsetup.customer', 'varchar', '11', '4430');
+INSERT INTO `0_sys_prefs` VALUES ('debtors_act', 'glsetup.sales', 'varchar', '11', '1200');
+INSERT INTO `0_sys_prefs` VALUES ('default_sales_act', 'glsetup.sales', 'varchar', '11', '4010');
+INSERT INTO `0_sys_prefs` VALUES ('default_sales_discount_act', 'glsetup.sales', 'varchar', '11', '4510');
+INSERT INTO `0_sys_prefs` VALUES ('default_prompt_payment_act', 'glsetup.sales', 'varchar', '11', '4500');
+INSERT INTO `0_sys_prefs` VALUES ('default_delivery_required', 'glsetup.sales', 'smallint', '6', '1');
+INSERT INTO `0_sys_prefs` VALUES ('default_dim_required', 'glsetup.dims', 'int', '11', '20');
+INSERT INTO `0_sys_prefs` VALUES ('pyt_discount_act', 'glsetup.purchase', 'varchar', '11', '5060');
+INSERT INTO `0_sys_prefs` VALUES ('creditors_act', 'glsetup.purchase', 'varchar', '11', '2100');
+INSERT INTO `0_sys_prefs` VALUES ('po_over_receive', 'glsetup.purchase', 'int', '11', '10');
+INSERT INTO `0_sys_prefs` VALUES ('po_over_charge', 'glsetup.purchase', 'int', '11', '10');
+INSERT INTO `0_sys_prefs` VALUES ('allow_negative_stock', 'glsetup.inventory', 'tinyint', '1', '0');
+INSERT INTO `0_sys_prefs` VALUES ('default_inventory_act', 'glsetup.items', 'varchar', '11', '1510');
+INSERT INTO `0_sys_prefs` VALUES ('default_cogs_act', 'glsetup.items', 'varchar', '11', '5010');
+INSERT INTO `0_sys_prefs` VALUES ('default_adj_act', 'glsetup.items', 'varchar', '11', '5040');
+INSERT INTO `0_sys_prefs` VALUES ('default_inv_sales_act', 'glsetup.items', 'varchar', '11', '4010');
+INSERT INTO `0_sys_prefs` VALUES ('default_assembly_act', 'glsetup.items', 'varchar', '11', '1530');
+INSERT INTO `0_sys_prefs` VALUES ('default_workorder_required', 'glsetup.manuf', 'int', '11', '20');
+INSERT INTO `0_sys_prefs` VALUES ('version_id', 'system', 'varchar', '11', '2.3');
+
 
 ### Structure of table `0_sys_types` ###
 
@@ -1594,14 +1699,13 @@ CREATE TABLE `0_tax_types` (
   `purchasing_gl_code` varchar(11) NOT NULL default '',
   `name` varchar(60) NOT NULL default '',
   `inactive` tinyint(1) NOT NULL default '0',
-  PRIMARY KEY  (`id`),
-  UNIQUE KEY `name` (`name`,`rate`)
+  PRIMARY KEY  (`id`)
 ) TYPE=InnoDB AUTO_INCREMENT=2 ;
 
 
 ### Data of table `0_tax_types` ###
 
-INSERT INTO `0_tax_types` VALUES ('1', '5', '2150', '2150', 'Tax', '0');
+INSERT INTO `0_tax_types` VALUES ('1', '5', '2150', '2145', 'Tax', '0');
 
 
 ### Structure of table `0_trans_tax_details` ###
@@ -1620,7 +1724,9 @@ CREATE TABLE `0_trans_tax_details` (
   `net_amount` double NOT NULL default '0',
   `amount` double NOT NULL default '0',
   `memo` tinytext,
-  PRIMARY KEY  (`id`)
+  PRIMARY KEY  (`id`),
+  KEY `Type_and_Number` (`trans_type`,`trans_no`),
+  KEY (`tran_date`)
 ) TYPE=InnoDB AUTO_INCREMENT=1 ;
 
 
@@ -1717,7 +1823,8 @@ CREATE TABLE `0_wo_issues` (
   `issue_date` date default NULL,
   `loc_code` varchar(5) default NULL,
   `workcentre_id` int(11) default NULL,
-  PRIMARY KEY  (`issue_no`)
+  PRIMARY KEY  (`issue_no`),
+  KEY (`workorder_id`)
 ) TYPE=InnoDB  AUTO_INCREMENT=1 ;
 
 
@@ -1735,7 +1842,8 @@ CREATE TABLE `0_wo_manufacture` (
   `workorder_id` int(11) NOT NULL default '0',
   `quantity` double NOT NULL default '0',
   `date_` date NOT NULL default '0000-00-00',
-  PRIMARY KEY  (`id`)
+  PRIMARY KEY  (`id`),
+  KEY (`workorder_id`)
 ) TYPE=InnoDB  AUTO_INCREMENT=1 ;
 
 
@@ -1756,7 +1864,8 @@ CREATE TABLE `0_wo_requirements` (
   `std_cost` double NOT NULL default '0',
   `loc_code` char(5) NOT NULL default '',
   `units_issued` double NOT NULL default '0',
-  PRIMARY KEY  (`id`)
+  PRIMARY KEY  (`id`),
+  KEY (`workorder_id`)
 ) TYPE=InnoDB  AUTO_INCREMENT=1 ;
 
 
@@ -1849,6 +1958,7 @@ CREATE TABLE `0_useronline` (
        `ip` varchar(40) NOT NULL default '',
        `file` varchar(100) NOT NULL default '',
        PRIMARY KEY `id` (`id`) ,
-       KEY (`timestamp`) 
+       KEY (`timestamp`),
+       KEY(`ip`)
 ) TYPE=MYISAM AUTO_INCREMENT=1;