0001161: Fix index on stk_code in sales_order_details and item_code in purch_order_de...
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Tue, 14 Feb 2012 09:36:26 +0000 (10:36 +0100)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Tue, 14 Feb 2012 09:36:26 +0000 (10:36 +0100)
sql/alter2.4.sql
sql/en_US-demo.sql
sql/en_US-new.sql

index e3ac792981749171d924d5961f10e3d7f5979a12..218c1ce5d385a08e2a95e7d4959e784cb69ca8ee 100644 (file)
@@ -34,3 +34,5 @@ UPDATE `0_tax_group_items` tgi
                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`);
index 46424c31ce1056494700121430798cc683f1208d..d8281297c4fae4c167c83bdbfff2cbcd0eddfa2e 100644 (file)
@@ -1366,7 +1366,8 @@ CREATE TABLE IF NOT EXISTS `0_purch_order_details` (
   `quantity_ordered` double NOT NULL default '0',
   `quantity_received` double NOT NULL default '0',
   PRIMARY KEY  (`po_detail_item`),
-  KEY `order` (`order_no`,`po_detail_item`)
+  KEY `order` (`order_no`,`po_detail_item`),
+  KEY `itemcode` (`item_code`)
 ) ENGINE=InnoDB  AUTO_INCREMENT=6 ;
 
 --
@@ -1571,7 +1572,8 @@ CREATE TABLE IF NOT EXISTS `0_sales_order_details` (
   `quantity` double NOT NULL default '0',
   `discount_percent` double NOT NULL default '0',
   PRIMARY KEY  (`id`),
-  KEY `sorder` (`trans_type`,`order_no`)
+  KEY `sorder` (`trans_type`,`order_no`),
+  KEY `stkcode` (`stk_code`)
 ) ENGINE=InnoDB  AUTO_INCREMENT=6 ;
 
 --
index 839ff348f284bc48c5c0dcd8d0bfcf8cb09cf46e..f9d81ce47f5963ec5beececc36bee684d94cb73a 100644 (file)
@@ -1195,7 +1195,8 @@ CREATE TABLE IF NOT EXISTS `0_purch_order_details` (
   `quantity_ordered` double NOT NULL default '0',
   `quantity_received` double NOT NULL default '0',
   PRIMARY KEY  (`po_detail_item`),
-  KEY `order` (`order_no`,`po_detail_item`)
+  KEY `order` (`order_no`,`po_detail_item`),
+  KEY `itemcode` (`item_code`)
 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
 
 --
@@ -1388,7 +1389,8 @@ CREATE TABLE IF NOT EXISTS `0_sales_order_details` (
   `quantity` double NOT NULL default '0',
   `discount_percent` double NOT NULL default '0',
   PRIMARY KEY  (`id`),
-  KEY `sorder` (`trans_type`,`order_no`)
+  KEY `sorder` (`trans_type`,`order_no`),
+  KEY `stkcode` (`stk_code`)
 ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
 
 --