SCM

Forum: bugs

Monitor Forum | Start New Thread Start New Thread
RE: Unknown Open error [ reply ]
By: joe speigle on 2007-06-09 16:42
[forum:1002436]
i don't understand why it's a problem. However, here are fixes.
try this one first: (just change these in your wordpad or whatever)

-------- replace <:encoding with <:utf8 -------
open(IN,'<:utf8', $ARGV[0]) || die "can't open mysql dump file $ARGV[0]";
open(OUT,'>:utf8', $ARGV[1]) || die "can't open pg dump file $ARGV[1]";


------- just get rid of it entirely --------
open(IN,"<$ARGV[0]") || die "can't open mysql dump file $ARGV[0]";
open(OUT,">$ARGV[1]") || die "can't open pg dump file $ARGV[1]";


LET US KNOW WHAT HAPPENS.

thanks.

Unknown Open error [ reply ]
By: Dan Fontenot on 2007-06-08 20:58
[forum:1002433]
First, full disclosure:
1) I am brand new to Perl. I downloaded it once before, but never did anything with it.
2) I am an extreme newbie in Postgesql. I am attempting to learn it because I am trying to determine whether I would prefer to develop our application against MySQL or PostgreSQL. I am attempting to develop simple database/table creation scripts for each. I want to move completely away from MS SQL for numerous reasons.

With all that said, I downloaded this script, installed ActivePerl (Windows XP) with the defaults (no special settings, etc.).

I then attempted to run this script by executing the following command:
perl mysql2pgsql.perl mysql_input.sql pgsql_output.sql

Upon doing so, I consistently receive the following error message:
Unknown open() mode '<:encoding(utf8)' at mysql2pgsql.perl line 262

Here is the text of the sql script from MySQL that I attempted to run through perl conversion script:

DROP TABLE IF EXISTS `eShopTracker_2`.`BOL_customer_group`;
CREATE TABLE `eShopTracker_2`.`BOL_customer_group` (
`group_id` int(11) NOT NULL,
`group_name` varchar(50) default NULL,
`document_prefix` varchar(2) default NULL,
`inventory_group` int(11) default NULL,
`primary_customer_id` varchar(10) default NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

DROP TABLE IF EXISTS `eShopTracker_2`.`BOL_Customers`;
CREATE TABLE `eShopTracker_2`.`BOL_Customers` (
`CustNumber` varchar(10) NOT NULL,
`CustCode` varchar(4) default NULL,
`CustName` varchar(50) default NULL,
`customer_group` int(11) NOT NULL,
`CustAdr1` varchar(50) default NULL,
`CustAdr2` varchar(50) default NULL,
`CustCity` varchar(20) default NULL,
`CustState` varchar(2) default NULL,
`CustZip` varchar(12) default NULL,
`CustCountry` varchar(2) default NULL,
`CustPhone` varchar(20) default NULL,
`CustFax` varchar(20) default NULL,
`CustContact` varchar(50) default NULL,
`CustNotes` text,
`CustShipNotes` text,
`CustCID` varchar(25) default NULL,
`CustTaxable` bit(1) NOT NULL,
`CustTaxRate` double default NULL,
`tax_name_1` varchar(20) default NULL,
`tax_name_2` varchar(20) default NULL,
`tax_rate_2` float default NULL,
`modified_user` varchar(50) default NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

DROP TABLE IF EXISTS `eShopTracker_2`.`BRDLIB`;
CREATE TABLE `eShopTracker_2`.`BRDLIB` (
`BoardCode` varchar(255) default NULL,
`Quantity` int(11) default NULL,
`MaterialCode` varchar(25) default NULL,
`Length` float default NULL,
`Width` float default NULL,
`Thickness` float default NULL,
`Cost` float default NULL,
`InventoryLimit` tinyint(4) default NULL,
`Info` varchar(12) default NULL,
`Description` varchar(50) default NULL,
`Grain` bit(1) default NULL,
`BookLimit` tinyint(4) default NULL,
`MaterialParameter` varchar(8) default NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

DROP TABLE IF EXISTS `eShopTracker_2`.`carrier`;
CREATE TABLE `eShopTracker_2`.`carrier` (
`carrier_id` varchar(5) NOT NULL,
`carrier_name` varchar(50) NOT NULL,
PRIMARY KEY (`carrier_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

DROP TABLE IF EXISTS `eShopTracker_2`.`customer`;
CREATE TABLE `eShopTracker_2`.`customer` (
`customer_id` varchar(20) NOT NULL,
`group_id` int(11) default NULL,
`unit_code` varchar(10) default NULL,
`customer_name` varchar(50) NOT NULL,
`contact` varchar(50) default NULL,
`address_1` varchar(75) default NULL,
`address_2` varchar(75) default NULL,
`city` varchar(30) default NULL,
`state_province` varchar(2) default NULL,
`postal_code` varchar(11) default NULL,
`country` varchar(5) default NULL,
`phone` varchar(15) default NULL,
`fax` varchar(15) default NULL,
`notes` text,
`shipping` text,
`taxable` bit(1) default NULL,
`tax_name_1` varchar(20) default NULL,
`tax_name_2` varchar(20) default NULL,
`tax_rate_1` float default NULL,
`tax_rate_2` float default NULL,
`modified_date` timestamp NULL default NULL,
`modified_user` varchar(50) default NULL,
`bol_cid` varchar(10) default NULL,
PRIMARY KEY (`customer_id`),
KEY `FK_customer_customer_group` (`group_id`),
CONSTRAINT `FK_customer_customer_group` FOREIGN KEY (`group_id`) REFERENCES `customer_group` (`group_id`) ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

DROP TABLE IF EXISTS `eShopTracker_2`.`customer_group`;
CREATE TABLE `eShopTracker_2`.`customer_group` (
`group_id` int(11) NOT NULL,
`group_name` varchar(50) NOT NULL,
`document_prefix` varchar(5) default NULL,
`inventory_group` int(11) default NULL,
`primary_customer_id` varchar(10) default NULL,
PRIMARY KEY (`group_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

DROP TABLE IF EXISTS `eShopTracker_2`.`daily_production_item`;
CREATE TABLE `eShopTracker_2`.`daily_production_item` (
`production_item_id` int(11) NOT NULL,
`production_location_id` int(11) NOT NULL,
`item_project_id` int(11) NOT NULL,
`description` varchar(100) NOT NULL,
`priority` int(11) default NULL,
`asap` bit(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

DROP TABLE IF EXISTS `eShopTracker_2`.`daily_production_project`;
CREATE TABLE `eShopTracker_2`.`daily_production_project` (
`dp_project_id` int(11) NOT NULL,
`dp_project_code` varchar(15) NOT NULL,
`dp_project_name` varchar(50) default NULL,
`dp_project_description` varchar(100) default NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

DROP TABLE IF EXISTS `eShopTracker_2`.`inventory`;
CREATE TABLE `eShopTracker_2`.`inventory` (
`building_id` varchar(15) NOT NULL,
`item_id` varchar(8) NOT NULL,
`catery` varchar(20) NOT NULL,
`description` varchar(100) default NULL,
`part_number` varchar(25) default NULL,
`item_size` varchar(20) default NULL,
`unit_measure` varchar(10) default NULL,
`quantity` float default NULL,
`cost` float default NULL,
`customer` varchar(50) default NULL,
`component` varchar(50) default NULL,
`vendor` varchar(50) default NULL,
PRIMARY KEY (`building_id`,`item_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

DROP TABLE IF EXISTS `eShopTracker_2`.`inventory_group`;
CREATE TABLE `eShopTracker_2`.`inventory_group` (
`inventory_group_id` varchar(3) NOT NULL,
`customer_name` varchar(25) NOT NULL,
`inventory_type` varchar(25) NOT NULL,
PRIMARY KEY (`inventory_group_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

DROP TABLE IF EXISTS `eShopTracker_2`.`inventory_list`;
CREATE TABLE `eShopTracker_2`.`inventory_list` (
`building_id` varchar(15) default NULL,
`item_id` varchar(8) default NULL,
`catery` varchar(20) default NULL,
`description` varchar(100) default NULL,
`part_number` varchar(25) default NULL,
`item_size` varchar(20) default NULL,
`unit_measure` varchar(10) default NULL,
`quantity` float default NULL,
`cost` float default NULL,
`customer` varchar(50) default NULL,
`component` varchar(50) default NULL,
`vendor` varchar(50) default NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

DROP TABLE IF EXISTS `eShopTracker_2`.`invoice`;
CREATE TABLE `eShopTracker_2`.`invoice` (
`inv_number` varchar(20) NOT NULL,
`inv_date` datetime default NULL,
`is_estimate` bit(1) default NULL,
`customer_code` varchar(20) default NULL,
`bill_to_first_name` varchar(25) default NULL,
`bill_to_last_name` varchar(25) default NULL,
`bill_to_company` varchar(50) default NULL,
`bill_to_contact` varchar(40) default NULL,
`bill_to_address1` varchar(50) default NULL,
`bill_to_address2` varchar(50) default NULL,
`bill_to_city` varchar(30) default NULL,
`bill_to_state` varchar(2) default NULL,
`bill_to_zip` varchar(10) default NULL,
`bill_to_country` varchar(5) default NULL,
`bill_to_phone` varchar(15) default NULL,
`ship_to_first_name` varchar(25) default NULL,
`ship_to_last_name` varchar(25) default NULL,
`ship_to_company` varchar(50) default NULL,
`ship_to_contact` varchar(40) default NULL,
`ship_to_address1` varchar(50) default NULL,
`ship_to_address2` varchar(50) default NULL,
`ship_to_city` varchar(30) default NULL,
`ship_to_state` varchar(2) default NULL,
`ship_to_zip` varchar(10) default NULL,
`ship_to_country` varchar(5) default NULL,
`ship_to_phone` varchar(15) default NULL,
`customer_discount` decimal(5,2) default NULL,
`customer_order_number` varchar(20) default NULL,
`terms` varchar(20) default NULL,
`phone_primary` varchar(20) default NULL,
`tax_status` varchar(20) default NULL,
`account` varchar(20) default NULL,
`subtotal` float default NULL,
`taxable` float default NULL,
`tax_name_1` varchar(20) default NULL,
`tax_rate_1` decimal(7,4) default NULL,
`tax_amount_1` float default NULL,
`tax_name_2` varchar(20) default NULL,
`tax_rate_2` decimal(7,4) default NULL,
`tax_amount_2` float default NULL,
`total` float default NULL,
`amount_paid` float default NULL,
`balance` float default NULL,
`invoice_credit_limit` float default NULL,
`print_date` datetime default NULL,
`void_date` datetime default NULL,
`paid_date` datetime default NULL,
`delete_date` datetime default NULL,
`memo` text,
`email_date` datetime default NULL,
`date_entered` datetime default NULL,
`modified_date` timestamp NULL default NULL,
`modified_user` varchar(50) default NULL,
PRIMARY KEY (`inv_number`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

DROP TABLE IF EXISTS `eShopTracker_2`.`invoice_copy`;
CREATE TABLE `eShopTracker_2`.`invoice_copy` (
`inv_number` varchar(20) NOT NULL,
`inv_date` varchar(10) default NULL,
`is_estimate` bit(1) default NULL,
`customer_code` varchar(20) default NULL,
`bill_to_first_name` varchar(25) default NULL,
`bill_to_last_name` varchar(25) default NULL,
`bill_to_company` varchar(50) default NULL,
`bill_to_address1` varchar(50) default NULL,
`bill_to_address2` varchar(50) default NULL,
`bill_to_city` varchar(30) default NULL,
`bill_to_state` varchar(2) default NULL,
`bill_to_zip` varchar(10) default NULL,
`bill_to_country` varchar(5) default NULL,
`ship_to_first_name` varchar(25) default NULL,
`ship_to_last_name` varchar(25) default NULL,
`ship_to_company` varchar(50) default NULL,
`ship_to_address1` varchar(50) default NULL,
`ship_to_address2` varchar(50) default NULL,
`ship_to_city` varchar(30) default NULL,
`ship_to_state` varchar(2) default NULL,
`ship_to_zip` varchar(10) default NULL,
`ship_to_country` varchar(5) default NULL,
`customer_discount` decimal(5,2) default NULL,
`customer_order_number` varchar(20) default NULL,
`terms` varchar(20) default NULL,
`phone_primary` varchar(20) default NULL,
`tax_status` varchar(20) default NULL,
`account` varchar(20) default NULL,
`subtotal` float default NULL,
`tax_name_1` varchar(20) default NULL,
`tax_rate_1` decimal(7,4) default NULL,
`tax_amount_1` float default NULL,
`tax_total_1` float default NULL,
`tax_name_2` varchar(20) default NULL,
`tax_rate_2` decimal(7,4) default NULL,
`tax_amount_2` float default NULL,
`tax_total_2` float default NULL,
`total` float default NULL,
`amount_paid` float default NULL,
`balance` float default NULL,
`invoice_credit_limit` float default NULL,
`printed` bit(1) default NULL,
`print_date` datetime default NULL,
`voided` bit(1) default NULL,
`void_date` datetime default NULL,
`paid` bit(1) default NULL,
`paid_date` datetime default NULL,
`deleted` bit(1) default NULL,
`delete_date` datetime default NULL,
`memo` text,
`form_key` varchar(5) default NULL,
`emailed` bit(1) default NULL,
`email_date` datetime default NULL,
`extra1` varchar(20) default NULL,
`extra2` varchar(20) default NULL,
`extra3` varchar(20) default NULL,
`extra4` varchar(20) default NULL,
`extra5` varchar(20) default NULL,
`date_entered` datetime default NULL,
`modified_date` binary(8) default NULL,
`modified_user` varchar(50) default NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

DROP TABLE IF EXISTS `eShopTracker_2`.`invoice_items`;
CREATE TABLE `eShopTracker_2`.`invoice_items` (
`invoice` varchar(15) NOT NULL,
`line_number` int(11) NOT NULL,
`code` varchar(8) default NULL,
`description` varchar(255) default NULL,
`quantity` float default NULL,
`unit_cost` float default NULL,
`taxable` bit(1) NOT NULL,
`line_cost` float default NULL,
PRIMARY KEY (`invoice`,`line_number`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

DROP TABLE IF EXISTS `eShopTracker_2`.`invoice_items_copy`;
CREATE TABLE `eShopTracker_2`.`invoice_items_copy` (
`inv_item_id` int(11) NOT NULL,
`line_number` int(11) default NULL,
`invoice` varchar(15) default NULL,
`code` varchar(8) default NULL,
`description` varchar(255) default NULL,
`quantity` float default NULL,
`unit_cost` float default NULL,
`taxable` bit(1) NOT NULL,
`line_cost` float default NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

DROP TABLE IF EXISTS `eShopTracker_2`.`item`;
CREATE TABLE `eShopTracker_2`.`item` (
`item_id` varchar(8) NOT NULL,
`active` bit(1) default '',
`cutrite_code` varchar(25) default NULL,
`type` int(11) default NULL,
`catery` char(3) default NULL,
`nickname` varchar(25) default NULL,
`description_short` varchar(50) NOT NULL,
`description_long` varchar(100) NOT NULL,
`qty_on_hand_low` float default NULL,
`qty_on_hand_bulk` float default NULL,
`qty_wip_low` float default NULL,
`qty_wip_bulk` float default NULL,
`qty_job_queue_low` float default NULL,
`qty_job_queue_bulk` float default NULL,
`unit_low` varchar(10) default NULL,
`unit_bulk` varchar(10) default NULL,
`low_per_bulk` float default NULL,
`order_point_low` float default NULL,
`order_point_bulk` float default NULL,
`order_qty_low` float default NULL,
`order_qty_bulk` float default NULL,
`weight_low` float default NULL,
`weight_unit_low` varchar(5) default NULL,
`weight_bulk` float default NULL,
`weight_unit_bulk` varchar(5) default NULL,
`height_low` float default NULL,
`height_unit_low` varchar(5) default NULL,
`height_bulk` float default NULL,
`height_unit_bulk` varchar(5) default NULL,
`width_low` float default NULL,
`width_unit_low` varchar(5) default NULL,
`width_bulk` float default NULL,
`width_unit_bulk` varchar(5) default NULL,
`depth_low` float default NULL,
`depth_unit_low` varchar(5) default NULL,
`depth_bulk` float default NULL,
`depth_unit_bulk` varchar(5) default NULL,
PRIMARY KEY (`item_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

DROP TABLE IF EXISTS `eShopTracker_2`.`item_customer`;
CREATE TABLE `eShopTracker_2`.`item_customer` (
`ic_id` int(11) NOT NULL auto_increment,
`ic_item` varchar(8) NOT NULL,
`ic_customer` varchar(20) NOT NULL,
`ic_product_id` varchar(20) default NULL,
`ic_desc_short` varchar(50) default NULL,
`ic_desc_long` varchar(100) default NULL,
PRIMARY KEY (`ic_id`),
KEY `FK_item_customer_customer` (`ic_customer`),
KEY `FK_item_customer_item` (`ic_item`),
CONSTRAINT `FK_item_customer_customer` FOREIGN KEY (`ic_customer`) REFERENCES `customer` (`customer_id`) ON UPDATE CASCADE,
CONSTRAINT `FK_item_customer_item` FOREIGN KEY (`ic_item`) REFERENCES `item` (`item_id`) ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

DROP TABLE IF EXISTS `eShopTracker_2`.`item_cutrite_board`;
CREATE TABLE `eShopTracker_2`.`item_cutrite_board` (
`board_code` varchar(25) NOT NULL,
`material_code` varchar(25) NOT NULL,
`length` float NOT NULL,
`width` float NOT NULL,
`information` varchar(12) default NULL,
`quantity` int(11) NOT NULL,
`allocated` int(11) default NULL,
`cost` float NOT NULL default '0',
`inventory_limit` char(10) default NULL,
PRIMARY KEY (`board_code`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

DROP TABLE IF EXISTS `eShopTracker_2`.`item_cutrite_material`;
CREATE TABLE `eShopTracker_2`.`item_cutrite_material` (
`material_code` varchar(25) NOT NULL,
`description` varchar(50) NOT NULL,
`thickness` float NOT NULL,
`grain` bit(1) NOT NULL default '\0',
`book_limit` tinyint(4) default NULL,
`parameter` varchar(8) default NULL,
PRIMARY KEY (`material_code`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

DROP TABLE IF EXISTS `eShopTracker_2`.`item_hardware`;
CREATE TABLE `eShopTracker_2`.`item_hardware` (
`item_hardware_id` varchar(8) NOT NULL,
`item_hardware_size` varchar(25) default NULL,
`item_hardware_size_type` int(11) default NULL,
`item_hardware_um_low` varchar(5) default NULL,
`item_hardware_um_bulk` varchar(5) default NULL,
`item_hardware_um_order` varchar(5) default NULL,
`item_hardware_qty_reorder` decimal(18,0) default NULL,
`item_hardware_qty_order_point` decimal(18,0) default NULL,
PRIMARY KEY (`item_hardware_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

DROP TABLE IF EXISTS `eShopTracker_2`.`item_identify`;
CREATE TABLE `eShopTracker_2`.`item_identify` (
`identify_code` varchar(1) NOT NULL,
`consigned` bit(1) NOT NULL,
`name` varchar(50) default NULL,
`detail` text,
PRIMARY KEY (`identify_code`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

DROP TABLE IF EXISTS `eShopTracker_2`.`item_include`;
CREATE TABLE `eShopTracker_2`.`item_include` (
`ii_item_main_id` varchar(8) NOT NULL,
`ii_type` int(11) NOT NULL,
`ii_item_sub_id` varchar(8) NOT NULL,
`ii_qty_per` decimal(18,0) default NULL,
`ii_display_order` int(11) default NULL,
`ii_assembly_code` varchar(3) default NULL,
PRIMARY KEY (`ii_item_main_id`,`ii_item_sub_id`),
KEY `FK_item_include_item_include_type` (`ii_type`),
KEY `FK_item_include_sub_item` (`ii_item_sub_id`),
CONSTRAINT `FK_item_include_item_include_type` FOREIGN KEY (`ii_type`) REFERENCES `item_include_type` (`iit_id`) ON UPDATE CASCADE,
CONSTRAINT `FK_item_include_main_item` FOREIGN KEY (`ii_item_main_id`) REFERENCES `item` (`item_id`),
CONSTRAINT `FK_item_include_sub_item` FOREIGN KEY (`ii_item_sub_id`) REFERENCES `item` (`item_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

DROP TABLE IF EXISTS `eShopTracker_2`.`item_include_type`;
CREATE TABLE `eShopTracker_2`.`item_include_type` (
`iit_id` int(11) NOT NULL auto_increment,
`iit_name` varchar(15) NOT NULL,
`iit_desc` varchar(100) default NULL,
PRIMARY KEY (`iit_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

DROP TABLE IF EXISTS `eShopTracker_2`.`item_part`;
CREATE TABLE `eShopTracker_2`.`item_part` (
`item_part_id` varchar(8) NOT NULL,
`item_part_material_code` char(8) default NULL,
`item_dimensions_type` int(11) default NULL,
`item_part_width` decimal(18,0) default NULL,
`item_part_length` decimal(18,0) default NULL,
`item_part_saw` bit(1) default '\0',
`item_part_cnc` bit(1) default '\0',
`item_part_edge` tinyint(4) default '0',
`item_part_sand` bit(1) default '\0',
PRIMARY KEY (`item_part_id`),
CONSTRAINT `FK_item_part_item` FOREIGN KEY (`item_part_id`) REFERENCES `item` (`item_id`) ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

DROP TABLE IF EXISTS `eShopTracker_2`.`item_type`;
CREATE TABLE `eShopTracker_2`.`item_type` (
`item_type_id` int(11) NOT NULL auto_increment,
`item_type_name` varchar(25) NOT NULL,
`item_type_desc` varchar(100) default NULL,
PRIMARY KEY (`item_type_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

DROP TABLE IF EXISTS `eShopTracker_2`.`job`;
CREATE TABLE `eShopTracker_2`.`job` (
`job_id` int(11) NOT NULL auto_increment,
`job_type` int(11) NOT NULL,
`job_code` varchar(20) NOT NULL,
`job_order` int(11) default NULL,
`job_date_start_scheduled` datetime default NULL,
`job_date_start_actual` datetime default NULL,
`job_date_complete_scheduled` datetime default NULL,
`job_date_complete_actual` datetime default NULL,
`job_date_deadline` datetime default NULL,
`job_entry_date` datetime NOT NULL,
`job_entry_user` varchar(30) default NULL,
PRIMARY KEY (`job_id`),
KEY `FK_Table1_order` (`job_order`),
CONSTRAINT `FK_Table1_order` FOREIGN KEY (`job_order`) REFERENCES `order` (`order_id`) ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

DROP TABLE IF EXISTS `eShopTracker_2`.`load`;
CREATE TABLE `eShopTracker_2`.`load` (
`load_id` int(11) NOT NULL auto_increment,
`load_shipment` int(11) default NULL,
`load_type` int(11) default NULL,
`load_status` int(11) NOT NULL,
`load_date_scheduled` datetime default NULL,
`load_ship_notes` varchar(75) default NULL,
`load_billto_cust` varchar(20) NOT NULL,
`load_shipto_cust` varchar(20) NOT NULL,
`load_shipto_address_1` varchar(75) NOT NULL,
`load_shipto_address_2` varchar(75) default NULL,
`load_shipto_city` varchar(30) NOT NULL,
`load_shipto_state_province` varchar(2) NOT NULL,
`load_shipto_postal_code` varchar(11) NOT NULL,
`load_modified_date` timestamp NULL default NULL,
`load_modified_user` varchar(30) default NULL,
PRIMARY KEY (`load_id`),
KEY `FK_load_load_type` (`load_type`),
CONSTRAINT `FK_load_load_type` FOREIGN KEY (`load_type`) REFERENCES `load_type` (`load_type_id`) ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

DROP TABLE IF EXISTS `eShopTracker_2`.`load_type`;
CREATE TABLE `eShopTracker_2`.`load_type` (
`load_type_id` int(11) NOT NULL,
`load_type_code` varchar(10) default NULL,
`load_type_desc` varchar(100) default NULL,
PRIMARY KEY (`load_type_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

DROP TABLE IF EXISTS `eShopTracker_2`.`location`;
CREATE TABLE `eShopTracker_2`.`location` (
`location_id` varchar(50) NOT NULL,
`description` varchar(50) NOT NULL,
PRIMARY KEY (`location_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

DROP TABLE IF EXISTS `eShopTracker_2`.`MPO_BlanketDetails`;
CREATE TABLE `eShopTracker_2`.`MPO_BlanketDetails` (
`BLD_ID` int(11) NOT NULL,
`BLD_PONum` varchar(20) NOT NULL,
`BLD_VndMatCode` varchar(50) default NULL,
`BLD_MatCode` varchar(8) NOT NULL,
`BLD_DescCode` varchar(50) default NULL,
`BLD_Description` varchar(100) default NULL,
`BLD_MatQty` double default NULL,
`BLD_MatUM` varchar(10) default NULL,
`BLD_MatCostUnit` double default NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

DROP TABLE IF EXISTS `eShopTracker_2`.`MPO_BlanketSummary`;
CREATE TABLE `eShopTracker_2`.`MPO_BlanketSummary` (
`BLS_ID` int(11) NOT NULL,
`BLS_PONum` varchar(20) NOT NULL,
`BLS_DateIssued` datetime default NULL,
`BLS_DateTarget` datetime default NULL,
`BLS_CustomerCode` varchar(50) default NULL,
`BLS_ProjectCode` varchar(50) default NULL,
`BLS_ProjectName` varchar(50) default NULL,
`BLS_VendorCode` varchar(8) default NULL,
`BLS_Contact` varchar(50) default NULL,
`BLS_DateOrdered` datetime default NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

DROP TABLE IF EXISTS `eShopTracker_2`.`order`;
CREATE TABLE `eShopTracker_2`.`order` (
`order_id` int(11) NOT NULL auto_increment,
`customer` varchar(20) default NULL,
`order_date` datetime NOT NULL,
`comments` text,
`date_start_scheduled` datetime default NULL,
`date_start_actual` datetime default NULL,
`date_complete_scheduled` datetime default NULL,
`date_complete_actual` datetime default NULL,
`date_deadline` datetime default NULL,
`modified_date` datetime default NULL,
`modified_user` char(10) default NULL,
PRIMARY KEY (`order_id`),
KEY `FK_order_customer` (`customer`),
CONSTRAINT `FK_order_customer` FOREIGN KEY (`customer`) REFERENCES `customer` (`customer_id`) ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

DROP TABLE IF EXISTS `eShopTracker_2`.`order_item`;
CREATE TABLE `eShopTracker_2`.`order_item` (
`item_id` int(11) NOT NULL auto_increment,
`order_number` int(11) NOT NULL,
`item_code` varchar(8) NOT NULL,
`item_description` varchar(50) NOT NULL,
`order_level` int(11) NOT NULL,
`quantity` int(11) default NULL,
`price` decimal(18,0) default NULL,
`date_entry` datetime NOT NULL,
`date_start_scheduled` datetime default NULL,
`date_start_actual` datetime default NULL,
`date_complete_scheduled` datetime default NULL,
`date_complete_actual` datetime default NULL,
`date_deadline` datetime default NULL,
PRIMARY KEY (`item_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

DROP TABLE IF EXISTS `eShopTracker_2`.`order_load`;
CREATE TABLE `eShopTracker_2`.`order_load` (
`order_load_id` int(11) NOT NULL auto_increment,
`order_load_order` int(11) NOT NULL,
`order_load_load` int(11) NOT NULL,
PRIMARY KEY (`order_load_id`),
KEY `FK_order_load_load` (`order_load_load`),
KEY `FK_order_load_order` (`order_load_order`),
CONSTRAINT `FK_order_load_load` FOREIGN KEY (`order_load_load`) REFERENCES `load` (`load_id`) ON UPDATE CASCADE,
CONSTRAINT `FK_order_load_order` FOREIGN KEY (`order_load_order`) REFERENCES `order` (`order_id`) ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

DROP TABLE IF EXISTS `eShopTracker_2`.`po_blanket`;
CREATE TABLE `eShopTracker_2`.`po_blanket` (
`po_number` varchar(20) NOT NULL,
`po_date` datetime default NULL,
`production_date` datetime default NULL,
`vendor_id` varchar(50) NOT NULL,
`vendor_contact` varchar(50) default NULL,
`order_date` datetime default NULL,
`customer_id` int(11) default NULL,
`job_code` varchar(50) default NULL,
`job_description` varchar(50) default NULL,
PRIMARY KEY (`po_number`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

DROP TABLE IF EXISTS `eShopTracker_2`.`po_blanket_line`;
CREATE TABLE `eShopTracker_2`.`po_blanket_line` (
`po_number` varchar(20) NOT NULL,
`item_id` varchar(8) NOT NULL,
`vendor_item_id` varchar(50) default NULL,
`cutrite_material_code` varchar(50) default NULL,
`description` varchar(100) default NULL,
`quantity` float default NULL,
`unit_measure` varchar(10) default NULL,
`cost` float default NULL,
PRIMARY KEY (`po_number`,`item_id`),
CONSTRAINT `FK_po_blanket_line_po_blanket` FOREIGN KEY (`po_number`) REFERENCES `po_blanket` (`po_number`) ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

DROP TABLE IF EXISTS `eShopTracker_2`.`production_location`;
CREATE TABLE `eShopTracker_2`.`production_location` (
`production_location_id` int(11) NOT NULL auto_increment,
`name` varchar(50) NOT NULL,
`production_type_id` int(11) default NULL,
`notes` text,
PRIMARY KEY (`production_location_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

DROP TABLE IF EXISTS `eShopTracker_2`.`production_type`;
CREATE TABLE `eShopTracker_2`.`production_type` (
`production_type_id` int(11) NOT NULL,
`name` varchar(30) default NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

DROP TABLE IF EXISTS `eShopTracker_2`.`shipment`;
CREATE TABLE `eShopTracker_2`.`shipment` (
`shipment_id` int(11) NOT NULL auto_increment,
`shipment_carrier` varchar(5) default NULL,
`shipment_notes` varchar(50) default NULL,
`shipment_date_entry` datetime NOT NULL,
`shipment_date_scheduled` datetime default NULL,
`shipment_date_actual` datetime default NULL,
`shipment_comments` text,
`shipment_modified_date` timestamp NULL default NULL,
`shipemnt_modified_user` varchar(50) default NULL,
PRIMARY KEY (`shipment_id`),
KEY `FK_shipment_carrier` (`shipment_carrier`),
CONSTRAINT `FK_shipment_carrier` FOREIGN KEY (`shipment_carrier`) REFERENCES `carrier` (`carrier_id`) ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

DROP TABLE IF EXISTS `eShopTracker_2`.`shipment_item`;
CREATE TABLE `eShopTracker_2`.`shipment_item` (
`si_id` int(11) NOT NULL auto_increment,
`si_shipment` int(11) NOT NULL,
`si_order` int(11) NOT NULL,
`si_item` varchar(8) NOT NULL,
`si_desc` varchar(100) NOT NULL,
`si_qty` decimal(18,0) NOT NULL,
`si_date_entry` datetime NOT NULL,
`si_modified_date` timestamp NULL default NULL,
`si_modifiied_user` varchar(50) default NULL,
PRIMARY KEY (`si_id`),
KEY `FK_shipment_item_item` (`si_item`),
KEY `FK_shipment_item_order` (`si_order`),
KEY `FK_shipment_item_shipment` (`si_shipment`),
CONSTRAINT `FK_shipment_item_item` FOREIGN KEY (`si_item`) REFERENCES `item` (`item_id`) ON UPDATE CASCADE,
CONSTRAINT `FK_shipment_item_order` FOREIGN KEY (`si_order`) REFERENCES `order` (`order_id`) ON UPDATE CASCADE,
CONSTRAINT `FK_shipment_item_shipment` FOREIGN KEY (`si_shipment`) REFERENCES `shipment` (`shipment_id`) ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

DROP TABLE IF EXISTS `eShopTracker_2`.`shipment_order`;
CREATE TABLE `eShopTracker_2`.`shipment_order` (
`so_id` int(11) NOT NULL auto_increment,
`so_shipment` int(11) NOT NULL,
`so_order` int(11) NOT NULL,
PRIMARY KEY (`so_id`),
KEY `FK_shipment_order_order` (`so_order`),
KEY `FK_shipment_order_shipment` (`so_shipment`),
CONSTRAINT `FK_shipment_order_order` FOREIGN KEY (`so_order`) REFERENCES `order` (`order_id`) ON UPDATE CASCADE,
CONSTRAINT `FK_shipment_order_shipment` FOREIGN KEY (`so_shipment`) REFERENCES `shipment` (`shipment_id`) ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

DROP TABLE IF EXISTS `eShopTracker_2`.`size_measure`;
CREATE TABLE `eShopTracker_2`.`size_measure` (
`size_measure_id` varchar(5) NOT NULL,
`description` varchar(25) NOT NULL,
`measure_group` varchar(10) NOT NULL,
PRIMARY KEY (`size_measure_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

DROP TABLE IF EXISTS `eShopTracker_2`.`unit_measure`;
CREATE TABLE `eShopTracker_2`.`unit_measure` (
`unit_measure_id` varchar(5) NOT NULL,
`description` varchar(25) NOT NULL,
PRIMARY KEY (`unit_measure_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

DROP TABLE IF EXISTS `eShopTracker_2`.`vendor`;
CREATE TABLE `eShopTracker_2`.`vendor` (
`vendor_id` int(11) NOT NULL auto_increment,
`vendor_code` varchar(8) default NULL,
`name` varchar(50) NOT NULL,
`contact1` varchar(50) default NULL,
`contact1_type` varchar(50) default NULL,
`contact1_phone_cell` varchar(11) default NULL,
`contact1_email` varchar(50) default NULL,
`contact2` varchar(50) default NULL,
`contact2_type` varchar(50) default NULL,
`contact2_email` varchar(50) default NULL,
`contact2_phone_cell` varchar(11) default NULL,
`address1` varchar(50) default NULL,
`address2` varchar(50) default NULL,
`city` varchar(25) default NULL,
`state` varchar(50) default NULL,
`zip` varchar(9) default NULL,
`country` varchar(2) default NULL,
`phone1` varchar(11) default NULL,
`phone1_ext` varchar(6) default NULL,
`phone2` varchar(11) default NULL,
`phone2_ext` varchar(50) default NULL,
`fax` varchar(10) default NULL,
`website` varchar(50) default NULL,
`comments` text,
`active` bit(1) NOT NULL default '',
PRIMARY KEY (`vendor_id`),
UNIQUE KEY `IX_vendor` (`vendor_code`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

DROP TABLE IF EXISTS `eShopTracker_2`.`weight_measure`;
CREATE TABLE `eShopTracker_2`.`weight_measure` (
`weight_measure_id` varchar(5) NOT NULL,
`description` varchar(25) NOT NULL,
`measure_group` varchar(10) NOT NULL,
PRIMARY KEY (`weight_measure_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

DROP TABLE IF EXISTS `eShopTracker_2`.`z_daily_production_overview`;
CREATE TABLE `eShopTracker_2`.`z_daily_production_overview` (
`zdp_overview_id` int(11) NOT NULL,
`Saw_HPL-22` text,
`Saw_HPL-22_Asap` text,
`Saw_HK-11` text,
`Saw_HK-11_Asap` text,
`EdgeBand_#1` text,
`EdgeBand_#1_Asap` text,
`EdgeBand_#2` text,
`EdgeBand_#2_Asap` text,
`EdgeBand_#3` text,
`EdgeBand_#3_Asap` text,
`Biesse_West_(Old_South)` text,
`Biesse_West_(Old_South)_Asap` text,
`Biesse_East_(Old_North)` text,
`Biesse_East_(Old_North)_Asap` text,
`Weeke_South` text,
`Weeke_South_Asap` text,
`Weeke_North` text,
`Weeke_North_Asap` text,
`BHT_500` text,
`BHT_500_Asap` text,
`1712_To_1805` text,
`1712_To_1805_Asap` text,
`1712_to_1708` text,
`1712_to_1708_Asap` text,
`1712_To_1809` text,
`1712_To_1809_Asap` text,
`Rollcoat` text,
`Rollcoat_Asap` text,
`Assembly_#1` text,
`Assembly_#1_Asap` text,
`Assembly_#2` text,
`Assembly_#2_Asap` text,
`Laminate` text,
`Laminate_Asap` text,
`Assembly_Cashwrap` text,
`Assembly_Cashwrap_Asap` text,
`Gamestop` text,
`Gamestop_Asap` text,
`Pier_Cash` text,
`Pier_Cash_Asap` text,
`1805_To_1712` text,
`1805_To_1712_Asap` text,
`1805_To_1708` text,
`1805_To_1708_Asap` text,
`1805_To_1809` text,
`1805_To_1809_Asap` text,
`Pack_@_1708/1712` text,
`Pack_@_1708/1712_Asap` text,
`Pack_@_1809` text,
`Pack_@_1809_Asap` text,
`Shipments_Today_@_1708` text,
`Shipments_Today_@_1708_Asap` text,
`Shipments_Today_@_1809` text,
`Shipments_Today_@_1809_Asap` text,
`1809/1805_To_1715` text,
`1809/1805_To_1715_Asap` text,
`1715_To_1809` text,
`1715_To_1809_Asap` text,
`1715_To_1712` text,
`1715_To_1712_Asap` text,
`Booth_#1_@_1715` text,
`Booth_#1_@_1715_Asap` text,
`Booth_#2_@1715` text,
`Booth_#2_@1715_Asap` text,
`Stewart` text,
`Stewart_Asap` text,
`Bonnie` text,
`Bonnie_Asap` text,
`Gary` text,
`Gary_Asap` text,
`Aaron` text,
`Aaron_Asap` text,
`Robert` text,
`Robert_Asap` text,
`Bill` text,
`Bill_Asap` text,
`Doug` text,
`Doug_Asap` text,
`Bob` text,
`Bob_Asap` text,
`David/Duc` text,
`David/Duc_Asap` text,
`Tung_Lam` text,
`Tung_Lam_Asap` text
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

Powered By FusionForge