MySQL 5.x.x problem fixed. Inserted default values in item_units
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Tue, 11 Mar 2008 23:17:11 +0000 (23:17 +0000)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Tue, 11 Mar 2008 23:17:11 +0000 (23:17 +0000)
sql/alter.sql

index ae2fd8176b6e781b4fbaa7390e60a40658dbefc7..0ce763f6e1f745a14d5382cd48a31c058a97a040 100644 (file)
 -- ALTER TABLE
 -- 
 
-CREATE TABLE `0_item_units` (
-  `abbr` VARCHAR(20) NOT NULL, 
-  `name` VARCHAR(40) NOT NULL, 
-  `decimals` TINYINT(2) NOT NULL,
+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 (`name`)
-)
-TYPE = myisam
-COMMENT = 'units of measure';
+  UNIQUE KEY `name` (`name`)
+) TYPE = MyISAM;
+INSERT INTO `0_item_units` VALUES ('each', 'Each', '0');
+INSERT INTO `0_item_units` VALUES ('m', 'Meter', '0');
+INSERT INTO `0_item_units` VALUES ('kg', 'Kilogram', '0');
+INSERT INTO `0_item_units` VALUES ('tons', 'Tons', '0');
+INSERT INTO `0_item_units` VALUES ('l', 'Liter', '0');
+INSERT INTO `0_item_units` VALUES ('lbs', 'Pounds', '0');
+INSERT INTO `0_item_units` VALUES ('dozen', 'Dozen', '0');
+INSERT INTO `0_item_units` VALUES ('pack', 'Pack', '0');
+INSERT INTO `0_item_units` VALUES ('hrs', 'Hours', '0');
 
 DROP TABLE IF EXISTS `0_form_items`;