-- Table structure for table `FACILITY_ATTRIBUTE`
--

DROP TABLE IF EXISTS `FACILITY_ATTRIBUTE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `FACILITY_ATTRIBUTE` (
  `FACILITY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ATTR_NAME` varchar(60) COLLATE latin1_general_cs NOT NULL,
  `ATTR_VALUE` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`FACILITY_ID`,`ATTR_NAME`),
  KEY `FACILITY_ATTR` (`FACILITY_ID`),
  KEY `FCLT_ATTRBT_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `FCLT_ATTRBT_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `FACILITY_ATTR` FOREIGN KEY (`FACILITY_ID`) REFERENCES `FACILITY` (`FACILITY_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `FACILITY_CARRIER_SHIPMENT`
--

DROP TABLE IF EXISTS `FACILITY_CARRIER_SHIPMENT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `FACILITY_CARRIER_SHIPMENT` (
  `FACILITY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ROLE_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `SHIPMENT_METHOD_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`FACILITY_ID`,`PARTY_ID`,`ROLE_TYPE_ID`,`SHIPMENT_METHOD_TYPE_ID`),
  KEY `FACILITY_CSH_PTY` (`PARTY_ID`),
  KEY `FACILITY_CSH_FAC` (`FACILITY_ID`),
  KEY `FACILITY_CSH_STP` (`SHIPMENT_METHOD_TYPE_ID`),
  KEY `FACILITY_CSH_CSM` (`SHIPMENT_METHOD_TYPE_ID`,`PARTY_ID`,`ROLE_TYPE_ID`),
  KEY `FCT_CRR_SHPT_TXSTP` (`LAST_UPDATED_TX_STAMP`),
  KEY `FCT_CRR_SHPT_TXCRS` (`CREATED_TX_STAMP`),
  CONSTRAINT `FACILITY_CSH_CSM` FOREIGN KEY (`SHIPMENT_METHOD_TYPE_ID`, `PARTY_ID`, `ROLE_TYPE_ID`) REFERENCES `CARRIER_SHIPMENT_METHOD` (`SHIPMENT_METHOD_TYPE_ID`, `PARTY_ID`, `ROLE_TYPE_ID`),
  CONSTRAINT `FACILITY_CSH_FAC` FOREIGN KEY (`FACILITY_ID`) REFERENCES `FACILITY` (`FACILITY_ID`),
  CONSTRAINT `FACILITY_CSH_PTY` FOREIGN KEY (`PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `FACILITY_CSH_STP` FOREIGN KEY (`SHIPMENT_METHOD_TYPE_ID`) REFERENCES `SHIPMENT_METHOD_TYPE` (`SHIPMENT_METHOD_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `FACILITY_CONTACT_MECH`
--

DROP TABLE IF EXISTS `FACILITY_CONTACT_MECH`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `FACILITY_CONTACT_MECH` (
  `FACILITY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CONTACT_MECH_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FROM_DATE` datetime NOT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `EXTENSION` varchar(10) COLLATE latin1_general_cs DEFAULT NULL,
  `COMMENTS` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`FACILITY_ID`,`CONTACT_MECH_ID`,`FROM_DATE`),
  KEY `FACIL_CMECH_FACIL` (`FACILITY_ID`),
  KEY `FACIL_CMECH_CMECH` (`CONTACT_MECH_ID`),
  KEY `FCT_CNTT_MCH_TXSTP` (`LAST_UPDATED_TX_STAMP`),
  KEY `FCT_CNTT_MCH_TXCRS` (`CREATED_TX_STAMP`),
  CONSTRAINT `FACIL_CMECH_CMECH` FOREIGN KEY (`CONTACT_MECH_ID`) REFERENCES `CONTACT_MECH` (`CONTACT_MECH_ID`),
  CONSTRAINT `FACIL_CMECH_FACIL` FOREIGN KEY (`FACILITY_ID`) REFERENCES `FACILITY` (`FACILITY_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `FACILITY_CONTACT_MECH_PURPOSE`
--

DROP TABLE IF EXISTS `FACILITY_CONTACT_MECH_PURPOSE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `FACILITY_CONTACT_MECH_PURPOSE` (
  `FACILITY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CONTACT_MECH_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CONTACT_MECH_PURPOSE_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FROM_DATE` datetime NOT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`FACILITY_ID`,`CONTACT_MECH_ID`,`CONTACT_MECH_PURPOSE_TYPE_ID`,`FROM_DATE`),
  KEY `FACIL_CMPRP_TYPE` (`CONTACT_MECH_PURPOSE_TYPE_ID`),
  KEY `FACIL_CMPRP_FACIL` (`FACILITY_ID`),
  KEY `FACIL_CMPRP_CMECH` (`CONTACT_MECH_ID`),
  KEY `FCT_CNT_MCH_PRS_TP` (`LAST_UPDATED_TX_STAMP`),
  KEY `FCT_CNT_MCH_PRS_TS` (`CREATED_TX_STAMP`),
  CONSTRAINT `FACIL_CMPRP_CMECH` FOREIGN KEY (`CONTACT_MECH_ID`) REFERENCES `CONTACT_MECH` (`CONTACT_MECH_ID`),
  CONSTRAINT `FACIL_CMPRP_FACIL` FOREIGN KEY (`FACILITY_ID`) REFERENCES `FACILITY` (`FACILITY_ID`),
  CONSTRAINT `FACIL_CMPRP_TYPE` FOREIGN KEY (`CONTACT_MECH_PURPOSE_TYPE_ID`) REFERENCES `CONTACT_MECH_PURPOSE_TYPE` (`CONTACT_MECH_PURPOSE_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `FACILITY_CONTENT`
--

DROP TABLE IF EXISTS `FACILITY_CONTENT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `FACILITY_CONTENT` (
  `FACILITY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CONTENT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FROM_DATE` datetime NOT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`FACILITY_ID`,`CONTENT_ID`,`FROM_DATE`),
  KEY `FAC_CNT_FAC` (`FACILITY_ID`),
  KEY `FAC_CNT_CNT` (`CONTENT_ID`),
  KEY `FCLT_CNTNT_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `FCLT_CNTNT_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `FAC_CNT_CNT` FOREIGN KEY (`CONTENT_ID`) REFERENCES `CONTENT` (`CONTENT_ID`),
  CONSTRAINT `FAC_CNT_FAC` FOREIGN KEY (`FACILITY_ID`) REFERENCES `FACILITY` (`FACILITY_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `FACILITY_GROUP`
--

DROP TABLE IF EXISTS `FACILITY_GROUP`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `FACILITY_GROUP` (
  `FACILITY_GROUP_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FACILITY_GROUP_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PRIMARY_PARENT_GROUP_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `FACILITY_GROUP_NAME` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`FACILITY_GROUP_ID`),
  KEY `FACILITY_GP_TYPE` (`FACILITY_GROUP_TYPE_ID`),
  KEY `FACILITY_GP_PGRP` (`PRIMARY_PARENT_GROUP_ID`),
  KEY `FCLT_GRP_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `FCLT_GRP_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `FACILITY_GP_PGRP` FOREIGN KEY (`PRIMARY_PARENT_GROUP_ID`) REFERENCES `FACILITY_GROUP` (`FACILITY_GROUP_ID`),
  CONSTRAINT `FACILITY_GP_TYPE` FOREIGN KEY (`FACILITY_GROUP_TYPE_ID`) REFERENCES `FACILITY_GROUP_TYPE` (`FACILITY_GROUP_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `FACILITY_GROUP_MEMBER`
--

DROP TABLE IF EXISTS `FACILITY_GROUP_MEMBER`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `FACILITY_GROUP_MEMBER` (
  `FACILITY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FACILITY_GROUP_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FROM_DATE` datetime NOT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `SEQUENCE_NUM` decimal(20,0) DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`FACILITY_ID`,`FACILITY_GROUP_ID`,`FROM_DATE`),
  KEY `FACILITY_MEM_FAC` (`FACILITY_ID`),
  KEY `FACILITY_MEM_FGRP` (`FACILITY_GROUP_ID`),
  KEY `FCT_GRP_MMR_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `FCT_GRP_MMR_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `FACILITY_MEM_FAC` FOREIGN KEY (`FACILITY_ID`) REFERENCES `FACILITY` (`FACILITY_ID`),
  CONSTRAINT `FACILITY_MEM_FGRP` FOREIGN KEY (`FACILITY_GROUP_ID`) REFERENCES `FACILITY_GROUP` (`FACILITY_GROUP_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `FACILITY_GROUP_ROLE`
--

DROP TABLE IF EXISTS `FACILITY_GROUP_ROLE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `FACILITY_GROUP_ROLE` (
  `FACILITY_GROUP_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ROLE_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`FACILITY_GROUP_ID`,`PARTY_ID`,`ROLE_TYPE_ID`),
  KEY `FGROUP_RLE_FGRP` (`FACILITY_GROUP_ID`),
  KEY `FGROUP_RLE_PTRLE` (`PARTY_ID`,`ROLE_TYPE_ID`),
  KEY `FCLT_GRP_RL_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `FCLT_GRP_RL_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `FGROUP_RLE_FGRP` FOREIGN KEY (`FACILITY_GROUP_ID`) REFERENCES `FACILITY_GROUP` (`FACILITY_GROUP_ID`),
  CONSTRAINT `FGROUP_RLE_PTRLE` FOREIGN KEY (`PARTY_ID`, `ROLE_TYPE_ID`) REFERENCES `PARTY_ROLE` (`PARTY_ID`, `ROLE_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `FACILITY_GROUP_ROLLUP`
--

DROP TABLE IF EXISTS `FACILITY_GROUP_ROLLUP`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `FACILITY_GROUP_ROLLUP` (
  `FACILITY_GROUP_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARENT_FACILITY_GROUP_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FROM_DATE` datetime NOT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `SEQUENCE_NUM` decimal(20,0) DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`FACILITY_GROUP_ID`,`PARENT_FACILITY_GROUP_ID`,`FROM_DATE`),
  KEY `FGRP_FRLP_CURRENT` (`FACILITY_GROUP_ID`),
  KEY `FGRP_FRLP_PARENT` (`PARENT_FACILITY_GROUP_ID`),
  KEY `FCT_GRP_RLP_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `FCT_GRP_RLP_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `FGRP_FRLP_CURRENT` FOREIGN KEY (`FACILITY_GROUP_ID`) REFERENCES `FACILITY_GROUP` (`FACILITY_GROUP_ID`),
  CONSTRAINT `FGRP_FRLP_PARENT` FOREIGN KEY (`PARENT_FACILITY_GROUP_ID`) REFERENCES `FACILITY_GROUP` (`FACILITY_GROUP_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `FACILITY_GROUP_TYPE`
--

DROP TABLE IF EXISTS `FACILITY_GROUP_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `FACILITY_GROUP_TYPE` (
  `FACILITY_GROUP_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`FACILITY_GROUP_TYPE_ID`),
  KEY `FCLT_GRP_TP_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `FCLT_GRP_TP_TXCRTS` (`CREATED_TX_STAMP`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `FACILITY_LOCATION`
--

DROP TABLE IF EXISTS `FACILITY_LOCATION`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `FACILITY_LOCATION` (
  `FACILITY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `LOCATION_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `LOCATION_TYPE_ENUM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `AREA_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `AISLE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SECTION_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `LEVEL_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `POSITION_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`FACILITY_ID`,`LOCATION_SEQ_ID`),
  KEY `FACILITY_LOC_FAC` (`FACILITY_ID`),
  KEY `FACILITY_LOC_TENM` (`LOCATION_TYPE_ENUM_ID`),
  KEY `FCLT_LCTN_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `FCLT_LCTN_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `FACILITY_LOC_FAC` FOREIGN KEY (`FACILITY_ID`) REFERENCES `FACILITY` (`FACILITY_ID`),
  CONSTRAINT `FACILITY_LOC_TENM` FOREIGN KEY (`LOCATION_TYPE_ENUM_ID`) REFERENCES `ENUMERATION` (`ENUM_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `FACILITY_LOCATION_GEO_POINT`
--

DROP TABLE IF EXISTS `FACILITY_LOCATION_GEO_POINT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `FACILITY_LOCATION_GEO_POINT` (
  `FACILITY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `LOCATION_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `GEO_POINT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FROM_DATE` datetime NOT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`FACILITY_ID`,`LOCATION_SEQ_ID`,`GEO_POINT_ID`,`FROM_DATE`),
  KEY `FACLOCGEOPT_FACLOC` (`FACILITY_ID`,`LOCATION_SEQ_ID`),
  KEY `FACLOCGEOPT_GEOPT` (`GEO_POINT_ID`),
  KEY `FCT_LCN_G_PNT_TXSP` (`LAST_UPDATED_TX_STAMP`),
  KEY `FCT_LCN_G_PNT_TXCS` (`CREATED_TX_STAMP`),
  CONSTRAINT `FACLOCGEOPT_FACLOC` FOREIGN KEY (`FACILITY_ID`, `LOCATION_SEQ_ID`) REFERENCES `FACILITY_LOCATION` (`FACILITY_ID`, `LOCATION_SEQ_ID`),
  CONSTRAINT `FACLOCGEOPT_GEOPT` FOREIGN KEY (`GEO_POINT_ID`) REFERENCES `GEO_POINT` (`GEO_POINT_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `FACILITY_PARTY`
--

DROP TABLE IF EXISTS `FACILITY_PARTY`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `FACILITY_PARTY` (
  `FACILITY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ROLE_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FROM_DATE` datetime NOT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`FACILITY_ID`,`PARTY_ID`,`ROLE_TYPE_ID`,`FROM_DATE`),
  KEY `FACILITY_RLE_FACI` (`FACILITY_ID`),
  KEY `FACILITY_RLE_PRT` (`PARTY_ID`),
  KEY `FACILITY_RLE_ROL` (`ROLE_TYPE_ID`),
  KEY `FACILITY_PRTY_ROLE` (`PARTY_ID`,`ROLE_TYPE_ID`),
  KEY `FCLT_PRT_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `FCLT_PRT_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `FACILITY_PRTY_ROLE` FOREIGN KEY (`PARTY_ID`, `ROLE_TYPE_ID`) REFERENCES `PARTY_ROLE` (`PARTY_ID`, `ROLE_TYPE_ID`),
  CONSTRAINT `FACILITY_RLE_FACI` FOREIGN KEY (`FACILITY_ID`) REFERENCES `FACILITY` (`FACILITY_ID`),
  CONSTRAINT `FACILITY_RLE_PRT` FOREIGN KEY (`PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `FACILITY_RLE_ROL` FOREIGN KEY (`ROLE_TYPE_ID`) REFERENCES `ROLE_TYPE` (`ROLE_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `FACILITY_ROLE`
--

DROP TABLE IF EXISTS `FACILITY_ROLE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `FACILITY_ROLE` (
  `FACILITY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ROLE_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`FACILITY_ID`,`PARTY_ID`,`ROLE_TYPE_ID`),
  KEY `FACILITY_RLE_FAC` (`FACILITY_ID`),
  KEY `FACILITY_RLE_PRTY` (`PARTY_ID`),
  KEY `FCLT_RL_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `FCLT_RL_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `FACILITY_RLE_FAC` FOREIGN KEY (`FACILITY_ID`) REFERENCES `FACILITY` (`FACILITY_ID`),
  CONSTRAINT `FACILITY_RLE_PRTY` FOREIGN KEY (`PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `FACILITY_TYPE`
--

DROP TABLE IF EXISTS `FACILITY_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `FACILITY_TYPE` (
  `FACILITY_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARENT_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `HAS_TABLE` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`FACILITY_TYPE_ID`),
  KEY `FACILITY_TYPEPAR` (`PARENT_TYPE_ID`),
  KEY `FCLT_TP_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `FCLT_TP_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `FACILITY_TYPEPAR` FOREIGN KEY (`PARENT_TYPE_ID`) REFERENCES `FACILITY_TYPE` (`FACILITY_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `FACILITY_TYPE_ATTR`
--

DROP TABLE IF EXISTS `FACILITY_TYPE_ATTR`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `FACILITY_TYPE_ATTR` (
  `FACILITY_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ATTR_NAME` varchar(60) COLLATE latin1_general_cs NOT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`FACILITY_TYPE_ID`,`ATTR_NAME`),
  KEY `FACILITY_TPAT_FT` (`FACILITY_TYPE_ID`),
  KEY `FCLT_TP_ATR_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `FCLT_TP_ATR_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `FACILITY_TPAT_FT` FOREIGN KEY (`FACILITY_TYPE_ID`) REFERENCES `FACILITY_TYPE` (`FACILITY_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `FILE_EXTENSION`
--

DROP TABLE IF EXISTS `FILE_EXTENSION`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `FILE_EXTENSION` (
  `FILE_EXTENSION_ID` varchar(60) COLLATE latin1_general_cs NOT NULL,
  `MIME_TYPE_ID` varchar(250) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`FILE_EXTENSION_ID`),
  KEY `FILEEXT_MMTYP` (`MIME_TYPE_ID`),
  KEY `FL_EXTNSN_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `FL_EXTNSN_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `FILEEXT_MMTYP` FOREIGN KEY (`MIME_TYPE_ID`) REFERENCES `MIME_TYPE` (`MIME_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `FIN_ACCOUNT`
--

DROP TABLE IF EXISTS `FIN_ACCOUNT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `FIN_ACCOUNT` (
  `FIN_ACCOUNT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FIN_ACCOUNT_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `STATUS_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `FIN_ACCOUNT_NAME` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `FIN_ACCOUNT_CODE` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `FIN_ACCOUNT_PIN` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `CURRENCY_UOM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ORGANIZATION_PARTY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `OWNER_PARTY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `POST_TO_GL_ACCOUNT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `FROM_DATE` datetime DEFAULT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `IS_REFUNDABLE` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `REPLENISH_PAYMENT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `REPLENISH_LEVEL` decimal(18,2) DEFAULT NULL,
  `ACTUAL_BALANCE` decimal(18,2) DEFAULT NULL,
  `AVAILABLE_BALANCE` decimal(18,2) DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`FIN_ACCOUNT_ID`),
  KEY `FINACCT_TYPE` (`FIN_ACCOUNT_TYPE_ID`),
  KEY `FINACCT_CURUOM` (`CURRENCY_UOM_ID`),
  KEY `FINACCT_ORGPTY` (`ORGANIZATION_PARTY_ID`),
  KEY `FINACCT_OWNPTY` (`OWNER_PARTY_ID`),
  KEY `FINACCT_GLAC` (`POST_TO_GL_ACCOUNT_ID`),
  KEY `FINACCT_PAYMETH` (`REPLENISH_PAYMENT_ID`),
  KEY `FIN_ACCOUNT_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `FIN_ACCOUNT_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `FINACCT_CURUOM` FOREIGN KEY (`CURRENCY_UOM_ID`) REFERENCES `UOM` (`UOM_ID`),
  CONSTRAINT `FINACCT_GLAC` FOREIGN KEY (`POST_TO_GL_ACCOUNT_ID`) REFERENCES `GL_ACCOUNT` (`GL_ACCOUNT_ID`),
  CONSTRAINT `FINACCT_ORGPTY` FOREIGN KEY (`ORGANIZATION_PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `FINACCT_OWNPTY` FOREIGN KEY (`OWNER_PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `FINACCT_PAYMETH` FOREIGN KEY (`REPLENISH_PAYMENT_ID`) REFERENCES `PAYMENT_METHOD` (`PAYMENT_METHOD_ID`),
  CONSTRAINT `FINACCT_TYPE` FOREIGN KEY (`FIN_ACCOUNT_TYPE_ID`) REFERENCES `FIN_ACCOUNT_TYPE` (`FIN_ACCOUNT_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `FIN_ACCOUNT_ATTRIBUTE`
--

DROP TABLE IF EXISTS `FIN_ACCOUNT_ATTRIBUTE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `FIN_ACCOUNT_ATTRIBUTE` (
  `FIN_ACCOUNT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ATTR_NAME` varchar(60) COLLATE latin1_general_cs NOT NULL,
  `ATTR_VALUE` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`FIN_ACCOUNT_ID`,`ATTR_NAME`),
  KEY `FINACCT_ATTR` (`FIN_ACCOUNT_ID`),
  KEY `FN_ACCT_ATTT_TXSTP` (`LAST_UPDATED_TX_STAMP`),
  KEY `FN_ACCT_ATTT_TXCRS` (`CREATED_TX_STAMP`),
  CONSTRAINT `FINACCT_ATTR` FOREIGN KEY (`FIN_ACCOUNT_ID`) REFERENCES `FIN_ACCOUNT` (`FIN_ACCOUNT_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `FIN_ACCOUNT_AUTH`
--

DROP TABLE IF EXISTS `FIN_ACCOUNT_AUTH`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `FIN_ACCOUNT_AUTH` (
  `FIN_ACCOUNT_AUTH_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FIN_ACCOUNT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `AMOUNT` decimal(18,2) DEFAULT NULL,
  `CURRENCY_UOM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `AUTHORIZATION_DATE` datetime DEFAULT NULL,
  `FROM_DATE` datetime DEFAULT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`FIN_ACCOUNT_AUTH_ID`),
  KEY `FINACT_AUTH_FINACT` (`FIN_ACCOUNT_ID`),
  KEY `FN_ACCT_ATH_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `FN_ACCT_ATH_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `FINACT_AUTH_FINACT` FOREIGN KEY (`FIN_ACCOUNT_ID`) REFERENCES `FIN_ACCOUNT` (`FIN_ACCOUNT_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `FIN_ACCOUNT_ROLE`
--

DROP TABLE IF EXISTS `FIN_ACCOUNT_ROLE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `FIN_ACCOUNT_ROLE` (
  `FIN_ACCOUNT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ROLE_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FROM_DATE` datetime NOT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`FIN_ACCOUNT_ID`,`PARTY_ID`,`ROLE_TYPE_ID`,`FROM_DATE`),
  KEY `FIN_ACT_RL_FNACT` (`FIN_ACCOUNT_ID`),
  KEY `FIN_ACT_RL_RTRL` (`PARTY_ID`,`ROLE_TYPE_ID`),
  KEY `FN_ACCNT_RL_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `FN_ACCNT_RL_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `FIN_ACT_RL_FNACT` FOREIGN KEY (`FIN_ACCOUNT_ID`) REFERENCES `FIN_ACCOUNT` (`FIN_ACCOUNT_ID`),
  CONSTRAINT `FIN_ACT_RL_RTRL` FOREIGN KEY (`PARTY_ID`, `ROLE_TYPE_ID`) REFERENCES `PARTY_ROLE` (`PARTY_ID`, `ROLE_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `FIN_ACCOUNT_STATUS`
--

DROP TABLE IF EXISTS `FIN_ACCOUNT_STATUS`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `FIN_ACCOUNT_STATUS` (
  `FIN_ACCOUNT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `STATUS_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `STATUS_DATE` datetime NOT NULL,
  `STATUS_END_DATE` datetime DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`FIN_ACCOUNT_ID`,`STATUS_ID`,`STATUS_DATE`),
  KEY `FINACT_STTS_FNA` (`FIN_ACCOUNT_ID`),
  KEY `FINACT_STTS_STI` (`STATUS_ID`),
  KEY `FN_ACCT_STS_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `FN_ACCT_STS_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `FINACT_STTS_FNA` FOREIGN KEY (`FIN_ACCOUNT_ID`) REFERENCES `FIN_ACCOUNT` (`FIN_ACCOUNT_ID`),
  CONSTRAINT `FINACT_STTS_STI` FOREIGN KEY (`STATUS_ID`) REFERENCES `STATUS_ITEM` (`STATUS_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `FIN_ACCOUNT_TRANS`
--

DROP TABLE IF EXISTS `FIN_ACCOUNT_TRANS`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `FIN_ACCOUNT_TRANS` (
  `FIN_ACCOUNT_TRANS_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FIN_ACCOUNT_TRANS_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `FIN_ACCOUNT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `GL_RECONCILIATION_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `TRANSACTION_DATE` datetime DEFAULT NULL,
  `ENTRY_DATE` datetime DEFAULT NULL,
  `AMOUNT` decimal(18,2) DEFAULT NULL,
  `PAYMENT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ORDER_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ORDER_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PERFORMED_BY_PARTY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `REASON_ENUM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `COMMENTS` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `STATUS_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`FIN_ACCOUNT_TRANS_ID`),
  KEY `FINACCT_TX_TYPE` (`FIN_ACCOUNT_TRANS_TYPE_ID`),
  KEY `FIN_ACT_TX_FNACT` (`FIN_ACCOUNT_ID`),
  KEY `FIN_ACT_TX_PARTY` (`PARTY_ID`),
  KEY `FIN_ACT_TX_PMT` (`PAYMENT_ID`),
  KEY `FIN_ACT_TX_ODITM` (`ORDER_ID`,`ORDER_ITEM_SEQ_ID`),
  KEY `FIN_ACT_TX_PBPTY` (`PERFORMED_BY_PARTY_ID`),
  KEY `FIN_ACT_REAS_ENUM` (`REASON_ENUM_ID`),
  KEY `FIN_ACT_TX_STI` (`STATUS_ID`),
  KEY `FIN_ACT_TX_GLREC` (`GL_RECONCILIATION_ID`),
  KEY `FN_ACCT_TRS_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `FN_ACCT_TRS_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `FINACCT_TX_TYPE` FOREIGN KEY (`FIN_ACCOUNT_TRANS_TYPE_ID`) REFERENCES `FIN_ACCOUNT_TRANS_TYPE` (`FIN_ACCOUNT_TRANS_TYPE_ID`),
  CONSTRAINT `FIN_ACT_REAS_ENUM` FOREIGN KEY (`REASON_ENUM_ID`) REFERENCES `ENUMERATION` (`ENUM_ID`),
  CONSTRAINT `FIN_ACT_TX_FNACT` FOREIGN KEY (`FIN_ACCOUNT_ID`) REFERENCES `FIN_ACCOUNT` (`FIN_ACCOUNT_ID`),
  CONSTRAINT `FIN_ACT_TX_GLREC` FOREIGN KEY (`GL_RECONCILIATION_ID`) REFERENCES `GL_RECONCILIATION` (`GL_RECONCILIATION_ID`),
  CONSTRAINT `FIN_ACT_TX_ODITM` FOREIGN KEY (`ORDER_ID`, `ORDER_ITEM_SEQ_ID`) REFERENCES `ORDER_ITEM` (`ORDER_ID`, `ORDER_ITEM_SEQ_ID`),
  CONSTRAINT `FIN_ACT_TX_PARTY` FOREIGN KEY (`PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `FIN_ACT_TX_PBPTY` FOREIGN KEY (`PERFORMED_BY_PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `FIN_ACT_TX_PMT` FOREIGN KEY (`PAYMENT_ID`) REFERENCES `PAYMENT` (`PAYMENT_ID`),
  CONSTRAINT `FIN_ACT_TX_STI` FOREIGN KEY (`STATUS_ID`) REFERENCES `STATUS_ITEM` (`STATUS_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `FIN_ACCOUNT_TRANS_ATTRIBUTE`
--

DROP TABLE IF EXISTS `FIN_ACCOUNT_TRANS_ATTRIBUTE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `FIN_ACCOUNT_TRANS_ATTRIBUTE` (
  `FIN_ACCOUNT_TRANS_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ATTR_NAME` varchar(60) COLLATE latin1_general_cs NOT NULL,
  `ATTR_VALUE` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`FIN_ACCOUNT_TRANS_ID`,`ATTR_NAME`),
  KEY `FINACCT_TX_ATTR` (`FIN_ACCOUNT_TRANS_ID`),
  KEY `FN_ACT_TRS_ATT_TXP` (`LAST_UPDATED_TX_STAMP`),
  KEY `FN_ACT_TRS_ATT_TXS` (`CREATED_TX_STAMP`),
  CONSTRAINT `FINACCT_TX_ATTR` FOREIGN KEY (`FIN_ACCOUNT_TRANS_ID`) REFERENCES `FIN_ACCOUNT_TRANS` (`FIN_ACCOUNT_TRANS_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `FIN_ACCOUNT_TRANS_TYPE`
--

DROP TABLE IF EXISTS `FIN_ACCOUNT_TRANS_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `FIN_ACCOUNT_TRANS_TYPE` (
  `FIN_ACCOUNT_TRANS_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARENT_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `HAS_TABLE` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`FIN_ACCOUNT_TRANS_TYPE_ID`),
  KEY `FINACCT_TX_TYPPAR` (`PARENT_TYPE_ID`),
  KEY `FN_ACT_TRS_TP_TXSP` (`LAST_UPDATED_TX_STAMP`),
  KEY `FN_ACT_TRS_TP_TXCS` (`CREATED_TX_STAMP`),
  CONSTRAINT `FINACCT_TX_TYPPAR` FOREIGN KEY (`PARENT_TYPE_ID`) REFERENCES `FIN_ACCOUNT_TRANS_TYPE` (`FIN_ACCOUNT_TRANS_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `FIN_ACCOUNT_TRANS_TYPE_ATTR`
--

DROP TABLE IF EXISTS `FIN_ACCOUNT_TRANS_TYPE_ATTR`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `FIN_ACCOUNT_TRANS_TYPE_ATTR` (
  `FIN_ACCOUNT_TRANS_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ATTR_NAME` varchar(60) COLLATE latin1_general_cs NOT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`FIN_ACCOUNT_TRANS_TYPE_ID`,`ATTR_NAME`),
  KEY `FINACCT_TX_TYPATR` (`FIN_ACCOUNT_TRANS_TYPE_ID`),
  KEY `FN_TRS_TP_ATR_TP` (`LAST_UPDATED_TX_STAMP`),
  KEY `FN_TRS_TP_ATR_TS` (`CREATED_TX_STAMP`),
  CONSTRAINT `FINACCT_TX_TYPATR` FOREIGN KEY (`FIN_ACCOUNT_TRANS_TYPE_ID`) REFERENCES `FIN_ACCOUNT_TRANS_TYPE` (`FIN_ACCOUNT_TRANS_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `FIN_ACCOUNT_TYPE`
--

DROP TABLE IF EXISTS `FIN_ACCOUNT_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `FIN_ACCOUNT_TYPE` (
  `FIN_ACCOUNT_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARENT_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `REPLENISH_ENUM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `IS_REFUNDABLE` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `HAS_TABLE` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`FIN_ACCOUNT_TYPE_ID`),
  KEY `FINACCT_TYPE_PAR` (`PARENT_TYPE_ID`),
  KEY `FINACCT_TYPE_RENUM` (`REPLENISH_ENUM_ID`),
  KEY `FN_ACCNT_TP_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `FN_ACCNT_TP_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `FINACCT_TYPE_PAR` FOREIGN KEY (`PARENT_TYPE_ID`) REFERENCES `FIN_ACCOUNT_TYPE` (`FIN_ACCOUNT_TYPE_ID`),
  CONSTRAINT `FINACCT_TYPE_RENUM` FOREIGN KEY (`REPLENISH_ENUM_ID`) REFERENCES `ENUMERATION` (`ENUM_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `FIN_ACCOUNT_TYPE_ATTR`
--

DROP TABLE IF EXISTS `FIN_ACCOUNT_TYPE_ATTR`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `FIN_ACCOUNT_TYPE_ATTR` (
  `FIN_ACCOUNT_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ATTR_NAME` varchar(60) COLLATE latin1_general_cs NOT NULL,
  `ATTR_VALUE` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`FIN_ACCOUNT_TYPE_ID`,`ATTR_NAME`),
  KEY `FINACCT_TYPE_ATTR` (`FIN_ACCOUNT_TYPE_ID`),
  KEY `FN_ACT_TP_ATR_TXSP` (`LAST_UPDATED_TX_STAMP`),
  KEY `FN_ACT_TP_ATR_TXCS` (`CREATED_TX_STAMP`),
  CONSTRAINT `FINACCT_TYPE_ATTR` FOREIGN KEY (`FIN_ACCOUNT_TYPE_ID`) REFERENCES `FIN_ACCOUNT_TYPE` (`FIN_ACCOUNT_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `FIN_ACCOUNT_TYPE_GL_ACCOUNT`
--

DROP TABLE IF EXISTS `FIN_ACCOUNT_TYPE_GL_ACCOUNT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `FIN_ACCOUNT_TYPE_GL_ACCOUNT` (
  `FIN_ACCOUNT_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ORGANIZATION_PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `GL_ACCOUNT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`FIN_ACCOUNT_TYPE_ID`,`ORGANIZATION_PARTY_ID`),
  KEY `FINACCT_TGA_PMT` (`FIN_ACCOUNT_TYPE_ID`),
  KEY `FINACCT_TGA_OPTY` (`ORGANIZATION_PARTY_ID`),
  KEY `FINACCT_TGA_GLAC` (`GL_ACCOUNT_ID`),
  KEY `FN_TP_GL_ACT_TP` (`LAST_UPDATED_TX_STAMP`),
  KEY `FN_TP_GL_ACT_TS` (`CREATED_TX_STAMP`),
  CONSTRAINT `FINACCT_TGA_GLAC` FOREIGN KEY (`GL_ACCOUNT_ID`) REFERENCES `GL_ACCOUNT` (`GL_ACCOUNT_ID`),
  CONSTRAINT `FINACCT_TGA_OPTY` FOREIGN KEY (`ORGANIZATION_PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `FINACCT_TGA_PMT` FOREIGN KEY (`FIN_ACCOUNT_TYPE_ID`) REFERENCES `FIN_ACCOUNT_TYPE` (`FIN_ACCOUNT_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `FIXED_ASSET`
--

DROP TABLE IF EXISTS `FIXED_ASSET`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `FIXED_ASSET` (
  `FIXED_ASSET_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FIXED_ASSET_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PARENT_FIXED_ASSET_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `INSTANCE_OF_PRODUCT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `CLASS_ENUM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ROLE_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `FIXED_ASSET_NAME` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `ACQUIRE_ORDER_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ACQUIRE_ORDER_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `DATE_ACQUIRED` datetime DEFAULT NULL,
  `DATE_LAST_SERVICED` datetime DEFAULT NULL,
  `DATE_NEXT_SERVICE` datetime DEFAULT NULL,
  `EXPECTED_END_OF_LIFE` date DEFAULT NULL,
  `ACTUAL_END_OF_LIFE` date DEFAULT NULL,
  `PRODUCTION_CAPACITY` decimal(18,6) DEFAULT NULL,
  `UOM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `CALENDAR_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SERIAL_NUMBER` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LOCATED_AT_FACILITY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `LOCATED_AT_LOCATION_SEQ_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SALVAGE_VALUE` decimal(18,2) DEFAULT NULL,
  `DEPRECIATION` decimal(18,2) DEFAULT NULL,
  `PURCHASE_COST` decimal(18,2) DEFAULT NULL,
  `PURCHASE_COST_UOM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`FIXED_ASSET_ID`),
  KEY `FIXEDAST_TYPE` (`FIXED_ASSET_TYPE_ID`),
  KEY `FIXEDAST_PAR` (`PARENT_FIXED_ASSET_ID`),
  KEY `FIXEDAST_IOPROD` (`INSTANCE_OF_PRODUCT_ID`),
  KEY `FIXEDAST_CLSENM` (`CLASS_ENUM_ID`),
  KEY `FIXEDAST_PARTY` (`PARTY_ID`),
  KEY `FIXEDAST_ROLETYP` (`ROLE_TYPE_ID`),
  KEY `FIXEDAST_ORDHDR` (`ACQUIRE_ORDER_ID`),
  KEY `FIXEDAST_ORDITM` (`ACQUIRE_ORDER_ID`,`ACQUIRE_ORDER_ITEM_SEQ_ID`),
  KEY `FIXEDAST_UOM` (`UOM_ID`),
  KEY `FIXEDAST_CALENDAR` (`CALENDAR_ID`),
  KEY `FIXEDAST_FAC` (`LOCATED_AT_FACILITY_ID`),
  KEY `FIXED_ASSET_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `FIXED_ASSET_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `FIXEDAST_CALENDAR` FOREIGN KEY (`CALENDAR_ID`) REFERENCES `TECH_DATA_CALENDAR` (`CALENDAR_ID`),
  CONSTRAINT `FIXEDAST_CLSENM` FOREIGN KEY (`CLASS_ENUM_ID`) REFERENCES `ENUMERATION` (`ENUM_ID`),
  CONSTRAINT `FIXEDAST_FAC` FOREIGN KEY (`LOCATED_AT_FACILITY_ID`) REFERENCES `FACILITY` (`FACILITY_ID`),
  CONSTRAINT `FIXEDAST_IOPROD` FOREIGN KEY (`INSTANCE_OF_PRODUCT_ID`) REFERENCES `PRODUCT` (`PRODUCT_ID`),
  CONSTRAINT `FIXEDAST_ORDHDR` FOREIGN KEY (`ACQUIRE_ORDER_ID`) REFERENCES `ORDER_HEADER` (`ORDER_ID`),
  CONSTRAINT `FIXEDAST_ORDITM` FOREIGN KEY (`ACQUIRE_ORDER_ID`, `ACQUIRE_ORDER_ITEM_SEQ_ID`) REFERENCES `ORDER_ITEM` (`ORDER_ID`, `ORDER_ITEM_SEQ_ID`),
  CONSTRAINT `FIXEDAST_PAR` FOREIGN KEY (`PARENT_FIXED_ASSET_ID`) REFERENCES `FIXED_ASSET` (`FIXED_ASSET_ID`),
  CONSTRAINT `FIXEDAST_PARTY` FOREIGN KEY (`PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `FIXEDAST_ROLETYP` FOREIGN KEY (`ROLE_TYPE_ID`) REFERENCES `ROLE_TYPE` (`ROLE_TYPE_ID`),
  CONSTRAINT `FIXEDAST_TYPE` FOREIGN KEY (`FIXED_ASSET_TYPE_ID`) REFERENCES `FIXED_ASSET_TYPE` (`FIXED_ASSET_TYPE_ID`),
  CONSTRAINT `FIXEDAST_UOM` FOREIGN KEY (`UOM_ID`) REFERENCES `UOM` (`UOM_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `FIXED_ASSET_ATTRIBUTE`
--

DROP TABLE IF EXISTS `FIXED_ASSET_ATTRIBUTE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `FIXED_ASSET_ATTRIBUTE` (
  `FIXED_ASSET_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ATTR_NAME` varchar(60) COLLATE latin1_general_cs NOT NULL,
  `ATTR_VALUE` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`FIXED_ASSET_ID`,`ATTR_NAME`),
  KEY `FIXEDAST_ATTR` (`FIXED_ASSET_ID`),
  KEY `FXD_AST_ATTT_TXSTP` (`LAST_UPDATED_TX_STAMP`),
  KEY `FXD_AST_ATTT_TXCRS` (`CREATED_TX_STAMP`),
  CONSTRAINT `FIXEDAST_ATTR` FOREIGN KEY (`FIXED_ASSET_ID`) REFERENCES `FIXED_ASSET` (`FIXED_ASSET_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `FIXED_ASSET_DEP_METHOD`
--

DROP TABLE IF EXISTS `FIXED_ASSET_DEP_METHOD`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `FIXED_ASSET_DEP_METHOD` (
  `DEPRECIATION_CUSTOM_METHOD_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FIXED_ASSET_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FROM_DATE` datetime DEFAULT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`DEPRECIATION_CUSTOM_METHOD_ID`,`FIXED_ASSET_ID`),
  KEY `FIXDAST_DM_CMET` (`DEPRECIATION_CUSTOM_METHOD_ID`),
  KEY `FIXDAST_DM_FXAST` (`FIXED_ASSET_ID`),
  KEY `FXD_AST_DP_MTD_TXP` (`LAST_UPDATED_TX_STAMP`),
  KEY `FXD_AST_DP_MTD_TXS` (`CREATED_TX_STAMP`),
  CONSTRAINT `FIXDAST_DM_CMET` FOREIGN KEY (`DEPRECIATION_CUSTOM_METHOD_ID`) REFERENCES `CUSTOM_METHOD` (`CUSTOM_METHOD_ID`),
  CONSTRAINT `FIXDAST_DM_FXAST` FOREIGN KEY (`FIXED_ASSET_ID`) REFERENCES `FIXED_ASSET` (`FIXED_ASSET_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `FIXED_ASSET_GEO_POINT`
--

DROP TABLE IF EXISTS `FIXED_ASSET_GEO_POINT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `FIXED_ASSET_GEO_POINT` (
  `FIXED_ASSET_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `GEO_POINT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FROM_DATE` datetime NOT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`FIXED_ASSET_ID`,`GEO_POINT_ID`,`FROM_DATE`),
  KEY `FXDASTGEOPT_FXDAST` (`FIXED_ASSET_ID`),
  KEY `FXDASTGEOPT_GEOPT` (`GEO_POINT_ID`),
  KEY `FXD_AST_G_PNT_TXSP` (`LAST_UPDATED_TX_STAMP`),
  KEY `FXD_AST_G_PNT_TXCS` (`CREATED_TX_STAMP`),
  CONSTRAINT `FXDASTGEOPT_FXDAST` FOREIGN KEY (`FIXED_ASSET_ID`) REFERENCES `FIXED_ASSET` (`FIXED_ASSET_ID`),
  CONSTRAINT `FXDASTGEOPT_GEOPT` FOREIGN KEY (`GEO_POINT_ID`) REFERENCES `GEO_POINT` (`GEO_POINT_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `FIXED_ASSET_IDENT`
--

DROP TABLE IF EXISTS `FIXED_ASSET_IDENT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `FIXED_ASSET_IDENT` (
  `FIXED_ASSET_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FIXED_ASSET_IDENT_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ID_VALUE` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`FIXED_ASSET_ID`,`FIXED_ASSET_IDENT_TYPE_ID`),
  KEY `FIXDASTID_FXAST` (`FIXED_ASSET_ID`),
  KEY `FIXDASTID_IDTYP` (`FIXED_ASSET_IDENT_TYPE_ID`),
  KEY `FXD_AST_IDT_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `FXD_AST_IDT_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `FIXDASTID_FXAST` FOREIGN KEY (`FIXED_ASSET_ID`) REFERENCES `FIXED_ASSET` (`FIXED_ASSET_ID`),
  CONSTRAINT `FIXDASTID_IDTYP` FOREIGN KEY (`FIXED_ASSET_IDENT_TYPE_ID`) REFERENCES `FIXED_ASSET_IDENT_TYPE` (`FIXED_ASSET_IDENT_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `FIXED_ASSET_IDENT_TYPE`
--

DROP TABLE IF EXISTS `FIXED_ASSET_IDENT_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `FIXED_ASSET_IDENT_TYPE` (
  `FIXED_ASSET_IDENT_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`FIXED_ASSET_IDENT_TYPE_ID`),
  KEY `FXD_AST_IDT_TP_TXP` (`LAST_UPDATED_TX_STAMP`),
  KEY `FXD_AST_IDT_TP_TXS` (`CREATED_TX_STAMP`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `FIXED_ASSET_MAINT`
--

DROP TABLE IF EXISTS `FIXED_ASSET_MAINT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `FIXED_ASSET_MAINT` (
  `FIXED_ASSET_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `MAINT_HIST_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `STATUS_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PRODUCT_MAINT_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PRODUCT_MAINT_SEQ_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SCHEDULE_WORK_EFFORT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `INTERVAL_QUANTITY` decimal(18,6) DEFAULT NULL,
  `INTERVAL_UOM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `INTERVAL_METER_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PURCHASE_ORDER_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`FIXED_ASSET_ID`,`MAINT_HIST_SEQ_ID`),
  KEY `FXDASTMNT_FXAST` (`FIXED_ASSET_ID`),
  KEY `FXDASTMNT_PMNTP` (`PRODUCT_MAINT_TYPE_ID`),
  KEY `FXDASTMNT_SCHWE` (`SCHEDULE_WORK_EFFORT_ID`),
  KEY `FXDASTMNT_INTUOM` (`INTERVAL_UOM_ID`),
  KEY `FXDASTMNT_PDMTTYP` (`INTERVAL_METER_TYPE_ID`),
  KEY `FXDASTMNT_PURORD` (`PURCHASE_ORDER_ID`),
  KEY `FXDASTMNT_SI` (`STATUS_ID`),
  KEY `FXD_AST_MNT_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `FXD_AST_MNT_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `FXDASTMNT_FXAST` FOREIGN KEY (`FIXED_ASSET_ID`) REFERENCES `FIXED_ASSET` (`FIXED_ASSET_ID`),
  CONSTRAINT `FXDASTMNT_INTUOM` FOREIGN KEY (`INTERVAL_UOM_ID`) REFERENCES `UOM` (`UOM_ID`),
  CONSTRAINT `FXDASTMNT_PDMTTYP` FOREIGN KEY (`INTERVAL_METER_TYPE_ID`) REFERENCES `PRODUCT_METER_TYPE` (`PRODUCT_METER_TYPE_ID`),
  CONSTRAINT `FXDASTMNT_PMNTP` FOREIGN KEY (`PRODUCT_MAINT_TYPE_ID`) REFERENCES `PRODUCT_MAINT_TYPE` (`PRODUCT_MAINT_TYPE_ID`),
  CONSTRAINT `FXDASTMNT_PURORD` FOREIGN KEY (`PURCHASE_ORDER_ID`) REFERENCES `ORDER_HEADER` (`ORDER_ID`),
  CONSTRAINT `FXDASTMNT_SCHWE` FOREIGN KEY (`SCHEDULE_WORK_EFFORT_ID`) REFERENCES `WORK_EFFORT` (`WORK_EFFORT_ID`),
  CONSTRAINT `FXDASTMNT_SI` FOREIGN KEY (`STATUS_ID`) REFERENCES `STATUS_ITEM` (`STATUS_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `FIXED_ASSET_MAINT_METER`
--

DROP TABLE IF EXISTS `FIXED_ASSET_MAINT_METER`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `FIXED_ASSET_MAINT_METER` (
  `FIXED_ASSET_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `MAINT_HIST_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_METER_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `METER_VALUE` decimal(18,6) DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`FIXED_ASSET_ID`,`MAINT_HIST_SEQ_ID`,`PRODUCT_METER_TYPE_ID`),
  KEY `FXDASTMNMT_FAMNT` (`FIXED_ASSET_ID`,`MAINT_HIST_SEQ_ID`),
  KEY `FXDASTMNMT_PMTYP` (`PRODUCT_METER_TYPE_ID`),
  KEY `FXD_AST_MNT_MTR_TP` (`LAST_UPDATED_TX_STAMP`),
  KEY `FXD_AST_MNT_MTR_TS` (`CREATED_TX_STAMP`),
  CONSTRAINT `FXDASTMNMT_FAMNT` FOREIGN KEY (`FIXED_ASSET_ID`, `MAINT_HIST_SEQ_ID`) REFERENCES `FIXED_ASSET_MAINT` (`FIXED_ASSET_ID`, `MAINT_HIST_SEQ_ID`),
  CONSTRAINT `FXDASTMNMT_PMTYP` FOREIGN KEY (`PRODUCT_METER_TYPE_ID`) REFERENCES `PRODUCT_METER_TYPE` (`PRODUCT_METER_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `FIXED_ASSET_MAINT_ORDER`
--

DROP TABLE IF EXISTS `FIXED_ASSET_MAINT_ORDER`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `FIXED_ASSET_MAINT_ORDER` (
  `FIXED_ASSET_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `MAINT_HIST_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ORDER_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ORDER_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`FIXED_ASSET_ID`,`MAINT_HIST_SEQ_ID`,`ORDER_ID`,`ORDER_ITEM_SEQ_ID`),
  KEY `FXDASTMNT_ORD_FXAS` (`FIXED_ASSET_ID`),
  KEY `FXDASTMNT_ORD` (`ORDER_ID`),
  KEY `FXD_AST_MNT_ORR_TP` (`LAST_UPDATED_TX_STAMP`),
  KEY `FXD_AST_MNT_ORR_TS` (`CREATED_TX_STAMP`),
  CONSTRAINT `FXDASTMNT_ORD` FOREIGN KEY (`ORDER_ID`) REFERENCES `ORDER_HEADER` (`ORDER_ID`),
  CONSTRAINT `FXDASTMNT_ORD_FXAS` FOREIGN KEY (`FIXED_ASSET_ID`) REFERENCES `FIXED_ASSET` (`FIXED_ASSET_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `FIXED_ASSET_METER`
--

DROP TABLE IF EXISTS `FIXED_ASSET_METER`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `FIXED_ASSET_METER` (
  `FIXED_ASSET_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_METER_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `READING_DATE` datetime NOT NULL,
  `METER_VALUE` decimal(18,6) DEFAULT NULL,
  `READING_REASON_ENUM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `MAINT_HIST_SEQ_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `WORK_EFFORT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`FIXED_ASSET_ID`,`PRODUCT_METER_TYPE_ID`,`READING_DATE`),
  KEY `FXDASTMTR_FAMNT` (`FIXED_ASSET_ID`,`MAINT_HIST_SEQ_ID`),
  KEY `FXDASTMTR_PMTYP` (`PRODUCT_METER_TYPE_ID`),
  KEY `FXD_AST_MTR_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `FXD_AST_MTR_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `FXDASTMTR_FAMNT` FOREIGN KEY (`FIXED_ASSET_ID`, `MAINT_HIST_SEQ_ID`) REFERENCES `FIXED_ASSET_MAINT` (`FIXED_ASSET_ID`, `MAINT_HIST_SEQ_ID`),
  CONSTRAINT `FXDASTMTR_PMTYP` FOREIGN KEY (`PRODUCT_METER_TYPE_ID`) REFERENCES `PRODUCT_METER_TYPE` (`PRODUCT_METER_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `FIXED_ASSET_PRODUCT`
--

DROP TABLE IF EXISTS `FIXED_ASSET_PRODUCT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `FIXED_ASSET_PRODUCT` (
  `FIXED_ASSET_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FIXED_ASSET_PRODUCT_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FROM_DATE` datetime NOT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `COMMENTS` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `SEQUENCE_NUM` decimal(20,0) DEFAULT NULL,
  `QUANTITY` decimal(18,6) DEFAULT NULL,
  `QUANTITY_UOM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`FIXED_ASSET_ID`,`PRODUCT_ID`,`FIXED_ASSET_PRODUCT_TYPE_ID`,`FROM_DATE`),
  KEY `FIXDASTPRD_PRD` (`PRODUCT_ID`),
  KEY `FIXDASTPRD_FA` (`FIXED_ASSET_ID`),
  KEY `FIXDASTPRD_FAPT` (`FIXED_ASSET_PRODUCT_TYPE_ID`),
  KEY `FIXDASTPRD_UOM` (`QUANTITY_UOM_ID`),
  KEY `FXD_AST_PRDT_TXSTP` (`LAST_UPDATED_TX_STAMP`),
  KEY `FXD_AST_PRDT_TXCRS` (`CREATED_TX_STAMP`),
  CONSTRAINT `FIXDASTPRD_FA` FOREIGN KEY (`FIXED_ASSET_ID`) REFERENCES `FIXED_ASSET` (`FIXED_ASSET_ID`),
  CONSTRAINT `FIXDASTPRD_FAPT` FOREIGN KEY (`FIXED_ASSET_PRODUCT_TYPE_ID`) REFERENCES `FIXED_ASSET_PRODUCT_TYPE` (`FIXED_ASSET_PRODUCT_TYPE_ID`),
  CONSTRAINT `FIXDASTPRD_PRD` FOREIGN KEY (`PRODUCT_ID`) REFERENCES `PRODUCT` (`PRODUCT_ID`),
  CONSTRAINT `FIXDASTPRD_UOM` FOREIGN KEY (`QUANTITY_UOM_ID`) REFERENCES `UOM` (`UOM_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `FIXED_ASSET_PRODUCT_TYPE`
--

DROP TABLE IF EXISTS `FIXED_ASSET_PRODUCT_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `FIXED_ASSET_PRODUCT_TYPE` (
  `FIXED_ASSET_PRODUCT_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`FIXED_ASSET_PRODUCT_TYPE_ID`),
  KEY `FXD_AST_PRT_TP_TXP` (`LAST_UPDATED_TX_STAMP`),
  KEY `FXD_AST_PRT_TP_TXS` (`CREATED_TX_STAMP`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `FIXED_ASSET_REGISTRATION`
--

DROP TABLE IF EXISTS `FIXED_ASSET_REGISTRATION`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `FIXED_ASSET_REGISTRATION` (
  `FIXED_ASSET_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FROM_DATE` datetime NOT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `REGISTRATION_DATE` datetime DEFAULT NULL,
  `GOV_AGENCY_PARTY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `REGISTRATION_NUMBER` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LICENSE_NUMBER` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`FIXED_ASSET_ID`,`FROM_DATE`),
  KEY `FIXDASTREG_FXAST` (`FIXED_ASSET_ID`),
  KEY `FIXDASTREG_GVAPTY` (`GOV_AGENCY_PARTY_ID`),
  KEY `FXD_AST_RGSTN_TXSP` (`LAST_UPDATED_TX_STAMP`),
  KEY `FXD_AST_RGSTN_TXCS` (`CREATED_TX_STAMP`),
  CONSTRAINT `FIXDASTREG_FXAST` FOREIGN KEY (`FIXED_ASSET_ID`) REFERENCES `FIXED_ASSET` (`FIXED_ASSET_ID`),
  CONSTRAINT `FIXDASTREG_GVAPTY` FOREIGN KEY (`GOV_AGENCY_PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `FIXED_ASSET_STD_COST`
--

DROP TABLE IF EXISTS `FIXED_ASSET_STD_COST`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `FIXED_ASSET_STD_COST` (
  `FIXED_ASSET_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FIXED_ASSET_STD_COST_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FROM_DATE` datetime NOT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `AMOUNT_UOM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `AMOUNT` decimal(18,2) DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`FIXED_ASSET_ID`,`FIXED_ASSET_STD_COST_TYPE_ID`,`FROM_DATE`),
  KEY `FIXASTCO_FIXAST` (`FIXED_ASSET_ID`),
  KEY `FIXASTCO_TYPCOS` (`FIXED_ASSET_STD_COST_TYPE_ID`),
  KEY `FIXASTCO_AMCURR` (`AMOUNT_UOM_ID`),
  KEY `FXD_AST_STD_CST_TP` (`LAST_UPDATED_TX_STAMP`),
  KEY `FXD_AST_STD_CST_TS` (`CREATED_TX_STAMP`),
  CONSTRAINT `FIXASTCO_AMCURR` FOREIGN KEY (`AMOUNT_UOM_ID`) REFERENCES `UOM` (`UOM_ID`),
  CONSTRAINT `FIXASTCO_FIXAST` FOREIGN KEY (`FIXED_ASSET_ID`) REFERENCES `FIXED_ASSET` (`FIXED_ASSET_ID`),
  CONSTRAINT `FIXASTCO_TYPCOS` FOREIGN KEY (`FIXED_ASSET_STD_COST_TYPE_ID`) REFERENCES `FIXED_ASSET_STD_COST_TYPE` (`FIXED_ASSET_STD_COST_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `FIXED_ASSET_STD_COST_TYPE`
--

DROP TABLE IF EXISTS `FIXED_ASSET_STD_COST_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `FIXED_ASSET_STD_COST_TYPE` (
  `FIXED_ASSET_STD_COST_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARENT_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `HAS_TABLE` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`FIXED_ASSET_STD_COST_TYPE_ID`),
  KEY `FIXASTCO_TYPPAR` (`PARENT_TYPE_ID`),
  KEY `FXD_STD_CST_TP_TP` (`LAST_UPDATED_TX_STAMP`),
  KEY `FXD_STD_CST_TP_TS` (`CREATED_TX_STAMP`),
  CONSTRAINT `FIXASTCO_TYPPAR` FOREIGN KEY (`PARENT_TYPE_ID`) REFERENCES `FIXED_ASSET_STD_COST_TYPE` (`FIXED_ASSET_STD_COST_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `FIXED_ASSET_TYPE`
--

DROP TABLE IF EXISTS `FIXED_ASSET_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `FIXED_ASSET_TYPE` (
  `FIXED_ASSET_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARENT_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `HAS_TABLE` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`FIXED_ASSET_TYPE_ID`),
  KEY `FIXEDAST_TYPPAR` (`PARENT_TYPE_ID`),
  KEY `FXD_ASST_TP_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `FXD_ASST_TP_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `FIXEDAST_TYPPAR` FOREIGN KEY (`PARENT_TYPE_ID`) REFERENCES `FIXED_ASSET_TYPE` (`FIXED_ASSET_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `FIXED_ASSET_TYPE_ATTR`
--

DROP TABLE IF EXISTS `FIXED_ASSET_TYPE_ATTR`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `FIXED_ASSET_TYPE_ATTR` (
  `FIXED_ASSET_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ATTR_NAME` varchar(60) COLLATE latin1_general_cs NOT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`FIXED_ASSET_TYPE_ID`,`ATTR_NAME`),
  KEY `FIXEDAST_TYPATTR` (`FIXED_ASSET_TYPE_ID`),
  KEY `FXD_AST_TP_ATR_TXP` (`LAST_UPDATED_TX_STAMP`),
  KEY `FXD_AST_TP_ATR_TXS` (`CREATED_TX_STAMP`),
  CONSTRAINT `FIXEDAST_TYPATTR` FOREIGN KEY (`FIXED_ASSET_TYPE_ID`) REFERENCES `FIXED_ASSET_TYPE` (`FIXED_ASSET_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `FIXED_ASSET_TYPE_GL_ACCOUNT`
--

DROP TABLE IF EXISTS `FIXED_ASSET_TYPE_GL_ACCOUNT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `FIXED_ASSET_TYPE_GL_ACCOUNT` (
  `FIXED_ASSET_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FIXED_ASSET_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ORGANIZATION_PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ASSET_GL_ACCOUNT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ACC_DEP_GL_ACCOUNT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `DEP_GL_ACCOUNT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PROFIT_GL_ACCOUNT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `LOSS_GL_ACCOUNT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`FIXED_ASSET_TYPE_ID`,`FIXED_ASSET_ID`,`ORGANIZATION_PARTY_ID`),
  KEY `FATGL_OP` (`ORGANIZATION_PARTY_ID`),
  KEY `FATGL_AGL` (`ASSET_GL_ACCOUNT_ID`),
  KEY `FATGL_ACCDGL` (`ACC_DEP_GL_ACCOUNT_ID`),
  KEY `FATGL_DGL` (`DEP_GL_ACCOUNT_ID`),
  KEY `FATGL_PGL` (`PROFIT_GL_ACCOUNT_ID`),
  KEY `FATGL_LGL` (`LOSS_GL_ACCOUNT_ID`),
  KEY `FXD_TP_GL_ACT_TP` (`LAST_UPDATED_TX_STAMP`),
  KEY `FXD_TP_GL_ACT_TS` (`CREATED_TX_STAMP`),
  CONSTRAINT `FATGL_ACCDGL` FOREIGN KEY (`ACC_DEP_GL_ACCOUNT_ID`) REFERENCES `GL_ACCOUNT` (`GL_ACCOUNT_ID`),
  CONSTRAINT `FATGL_AGL` FOREIGN KEY (`ASSET_GL_ACCOUNT_ID`) REFERENCES `GL_ACCOUNT` (`GL_ACCOUNT_ID`),
  CONSTRAINT `FATGL_DGL` FOREIGN KEY (`DEP_GL_ACCOUNT_ID`) REFERENCES `GL_ACCOUNT` (`GL_ACCOUNT_ID`),
  CONSTRAINT `FATGL_LGL` FOREIGN KEY (`LOSS_GL_ACCOUNT_ID`) REFERENCES `GL_ACCOUNT` (`GL_ACCOUNT_ID`),
  CONSTRAINT `FATGL_OP` FOREIGN KEY (`ORGANIZATION_PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `FATGL_PGL` FOREIGN KEY (`PROFIT_GL_ACCOUNT_ID`) REFERENCES `GL_ACCOUNT` (`GL_ACCOUNT_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `GEO`
--

DROP TABLE IF EXISTS `GEO`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `GEO` (
  `GEO_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `GEO_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `GEO_NAME` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `GEO_CODE` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `GEO_SEC_CODE` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `ABBREVIATION` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `WELL_KNOWN_TEXT` longtext COLLATE latin1_general_cs,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`GEO_ID`),
  KEY `GEO_TO_TYPE` (`GEO_TYPE_ID`),
  KEY `GEO_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `GEO_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `GEO_TO_TYPE` FOREIGN KEY (`GEO_TYPE_ID`) REFERENCES `GEO_TYPE` (`GEO_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `GEO_ASSOC`
--

DROP TABLE IF EXISTS `GEO_ASSOC`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `GEO_ASSOC` (
  `GEO_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `GEO_ID_TO` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `GEO_ASSOC_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`GEO_ID`,`GEO_ID_TO`),
  KEY `GEO_ASSC_TO_MAIN` (`GEO_ID`),
  KEY `GEO_ASSC_TO_ASSC` (`GEO_ID_TO`),
  KEY `GEO_ASSC_TO_TYPE` (`GEO_ASSOC_TYPE_ID`),
  KEY `GEO_ASSOC_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `GEO_ASSOC_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `GEO_ASSC_TO_ASSC` FOREIGN KEY (`GEO_ID_TO`) REFERENCES `GEO` (`GEO_ID`),
  CONSTRAINT `GEO_ASSC_TO_MAIN` FOREIGN KEY (`GEO_ID`) REFERENCES `GEO` (`GEO_ID`),
  CONSTRAINT `GEO_ASSC_TO_TYPE` FOREIGN KEY (`GEO_ASSOC_TYPE_ID`) REFERENCES `GEO_ASSOC_TYPE` (`GEO_ASSOC_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `GEO_ASSOC_TYPE`
--

DROP TABLE IF EXISTS `GEO_ASSOC_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `GEO_ASSOC_TYPE` (
  `GEO_ASSOC_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`GEO_ASSOC_TYPE_ID`),
  KEY `G_ASSC_TP_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `G_ASSC_TP_TXCRTS` (`CREATED_TX_STAMP`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `GEO_POINT`
--

DROP TABLE IF EXISTS `GEO_POINT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `GEO_POINT` (
  `GEO_POINT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `DATA_SOURCE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `LATITUDE` varchar(60) COLLATE latin1_general_cs NOT NULL,
  `LONGITUDE` varchar(60) COLLATE latin1_general_cs NOT NULL,
  `ELEVATION` decimal(18,6) DEFAULT NULL,
  `ELEVATION_UOM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `INFORMATION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`GEO_POINT_ID`),
  KEY `GEOPOINT_DTSRC` (`DATA_SOURCE_ID`),
  KEY `GPT_ELEV_UOM` (`ELEVATION_UOM_ID`),
  KEY `GEO_POINT_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `GEO_POINT_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `GEOPOINT_DTSRC` FOREIGN KEY (`DATA_SOURCE_ID`) REFERENCES `DATA_SOURCE` (`DATA_SOURCE_ID`),
  CONSTRAINT `GPT_ELEV_UOM` FOREIGN KEY (`ELEVATION_UOM_ID`) REFERENCES `UOM` (`UOM_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `GEO_TYPE`
--

DROP TABLE IF EXISTS `GEO_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `GEO_TYPE` (
  `GEO_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARENT_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `HAS_TABLE` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`GEO_TYPE_ID`),
  KEY `GEO_TYPE_PARENT` (`PARENT_TYPE_ID`),
  KEY `GEO_TYPE_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `GEO_TYPE_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `GEO_TYPE_PARENT` FOREIGN KEY (`PARENT_TYPE_ID`) REFERENCES `GEO_TYPE` (`GEO_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `GIFT_CARD`
--

DROP TABLE IF EXISTS `GIFT_CARD`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `GIFT_CARD` (
  `PAYMENT_METHOD_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CARD_NUMBER` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `PIN_NUMBER` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `EXPIRE_DATE` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `CONTACT_MECH_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`PAYMENT_METHOD_ID`),
  KEY `GIFTCARD_PMNTMETH` (`PAYMENT_METHOD_ID`),
  KEY `GIFTCARD_CMECH` (`CONTACT_MECH_ID`),
  KEY `GIFTCARD_PADDR` (`CONTACT_MECH_ID`),
  KEY `GIFT_CARD_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `GIFT_CARD_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `GIFTCARD_CMECH` FOREIGN KEY (`CONTACT_MECH_ID`) REFERENCES `CONTACT_MECH` (`CONTACT_MECH_ID`),
  CONSTRAINT `GIFTCARD_PADDR` FOREIGN KEY (`CONTACT_MECH_ID`) REFERENCES `POSTAL_ADDRESS` (`CONTACT_MECH_ID`),
  CONSTRAINT `GIFTCARD_PMNTMETH` FOREIGN KEY (`PAYMENT_METHOD_ID`) REFERENCES `PAYMENT_METHOD` (`PAYMENT_METHOD_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `GIFT_CARD_FULFILLMENT`
--

DROP TABLE IF EXISTS `GIFT_CARD_FULFILLMENT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `GIFT_CARD_FULFILLMENT` (
  `FULFILLMENT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `TYPE_ENUM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `MERCHANT_ID` varchar(250) COLLATE latin1_general_cs DEFAULT NULL,
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ORDER_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ORDER_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SURVEY_RESPONSE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `CARD_NUMBER` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `PIN_NUMBER` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `AMOUNT` decimal(18,2) DEFAULT NULL,
  `RESPONSE_CODE` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `REFERENCE_NUM` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `AUTH_CODE` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `FULFILLMENT_DATE` datetime DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`FULFILLMENT_ID`),
  KEY `GC_FILL_ENUM` (`TYPE_ENUM_ID`),
  KEY `GC_FILL_PARTY` (`PARTY_ID`),
  KEY `GC_FILL_ODRH` (`ORDER_ID`),
  KEY `GC_FILL_ODRI` (`ORDER_ID`,`ORDER_ITEM_SEQ_ID`),
  KEY `GC_FILL_SURVY` (`SURVEY_RESPONSE_ID`),
  KEY `GFT_CRD_FLFLT_TXSP` (`LAST_UPDATED_TX_STAMP`),
  KEY `GFT_CRD_FLFLT_TXCS` (`CREATED_TX_STAMP`),
  CONSTRAINT `GC_FILL_ENUM` FOREIGN KEY (`TYPE_ENUM_ID`) REFERENCES `ENUMERATION` (`ENUM_ID`),
  CONSTRAINT `GC_FILL_ODRH` FOREIGN KEY (`ORDER_ID`) REFERENCES `ORDER_HEADER` (`ORDER_ID`),
  CONSTRAINT `GC_FILL_ODRI` FOREIGN KEY (`ORDER_ID`, `ORDER_ITEM_SEQ_ID`) REFERENCES `ORDER_ITEM` (`ORDER_ID`, `ORDER_ITEM_SEQ_ID`),
  CONSTRAINT `GC_FILL_PARTY` FOREIGN KEY (`PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `GC_FILL_SURVY` FOREIGN KEY (`SURVEY_RESPONSE_ID`) REFERENCES `SURVEY_RESPONSE` (`SURVEY_RESPONSE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `GL_ACCOUNT`
--

DROP TABLE IF EXISTS `GL_ACCOUNT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `GL_ACCOUNT` (
  `GL_ACCOUNT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `GL_ACCOUNT_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `GL_ACCOUNT_CLASS_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `GL_RESOURCE_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `GL_XBRL_CLASS_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PARENT_GL_ACCOUNT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ACCOUNT_CODE` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `ACCOUNT_NAME` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `PRODUCT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `EXTERNAL_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`GL_ACCOUNT_ID`),
  UNIQUE KEY `GLACCT_UNQCD` (`ACCOUNT_CODE`),
  KEY `GLACCT_TYPE` (`GL_ACCOUNT_TYPE_ID`),
  KEY `GLACCT_CLSS` (`GL_ACCOUNT_CLASS_ID`),
  KEY `GLACCT_REC` (`GL_RESOURCE_TYPE_ID`),
  KEY `GLACCT_XBRLCLS` (`GL_XBRL_CLASS_ID`),
  KEY `GLACCT_PAR` (`PARENT_GL_ACCOUNT_ID`),
  KEY `GL_ACCOUNT_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `GL_ACCOUNT_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `GLACCT_CLSS` FOREIGN KEY (`GL_ACCOUNT_CLASS_ID`) REFERENCES `GL_ACCOUNT_CLASS` (`GL_ACCOUNT_CLASS_ID`),
  CONSTRAINT `GLACCT_PAR` FOREIGN KEY (`PARENT_GL_ACCOUNT_ID`) REFERENCES `GL_ACCOUNT` (`GL_ACCOUNT_ID`),
  CONSTRAINT `GLACCT_REC` FOREIGN KEY (`GL_RESOURCE_TYPE_ID`) REFERENCES `GL_RESOURCE_TYPE` (`GL_RESOURCE_TYPE_ID`),
  CONSTRAINT `GLACCT_TYPE` FOREIGN KEY (`GL_ACCOUNT_TYPE_ID`) REFERENCES `GL_ACCOUNT_TYPE` (`GL_ACCOUNT_TYPE_ID`),
  CONSTRAINT `GLACCT_XBRLCLS` FOREIGN KEY (`GL_XBRL_CLASS_ID`) REFERENCES `GL_XBRL_CLASS` (`GL_XBRL_CLASS_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `GL_ACCOUNT_CATEGORY`
--

DROP TABLE IF EXISTS `GL_ACCOUNT_CATEGORY`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `GL_ACCOUNT_CATEGORY` (
  `GL_ACCOUNT_CATEGORY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `GL_ACCOUNT_CATEGORY_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`GL_ACCOUNT_CATEGORY_ID`),
  KEY `GLACT_CAT_TP` (`GL_ACCOUNT_CATEGORY_TYPE_ID`),
  KEY `GL_ACCT_CTR_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `GL_ACCT_CTR_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `GLACT_CAT_TP` FOREIGN KEY (`GL_ACCOUNT_CATEGORY_TYPE_ID`) REFERENCES `GL_ACCOUNT_CATEGORY_TYPE` (`GL_ACCOUNT_CATEGORY_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `GL_ACCOUNT_CATEGORY_MEMBER`
--

DROP TABLE IF EXISTS `GL_ACCOUNT_CATEGORY_MEMBER`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `GL_ACCOUNT_CATEGORY_MEMBER` (
  `GL_ACCOUNT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `GL_ACCOUNT_CATEGORY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FROM_DATE` datetime NOT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `AMOUNT_PERCENTAGE` decimal(18,6) DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`GL_ACCOUNT_ID`,`GL_ACCOUNT_CATEGORY_ID`,`FROM_DATE`),
  KEY `GLACT_CATMBR_AC` (`GL_ACCOUNT_ID`),
  KEY `GLACT_CATMBR_CAT` (`GL_ACCOUNT_CATEGORY_ID`),
  KEY `GL_ACT_CTR_MMR_TXP` (`LAST_UPDATED_TX_STAMP`),
  KEY `GL_ACT_CTR_MMR_TXS` (`CREATED_TX_STAMP`),
  CONSTRAINT `GLACT_CATMBR_AC` FOREIGN KEY (`GL_ACCOUNT_ID`) REFERENCES `GL_ACCOUNT` (`GL_ACCOUNT_ID`),
  CONSTRAINT `GLACT_CATMBR_CAT` FOREIGN KEY (`GL_ACCOUNT_CATEGORY_ID`) REFERENCES `GL_ACCOUNT_CATEGORY` (`GL_ACCOUNT_CATEGORY_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `GL_ACCOUNT_CATEGORY_TYPE`
--

DROP TABLE IF EXISTS `GL_ACCOUNT_CATEGORY_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `GL_ACCOUNT_CATEGORY_TYPE` (
  `GL_ACCOUNT_CATEGORY_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`GL_ACCOUNT_CATEGORY_TYPE_ID`),
  KEY `GL_ACT_CTR_TP_TXSP` (`LAST_UPDATED_TX_STAMP`),
  KEY `GL_ACT_CTR_TP_TXCS` (`CREATED_TX_STAMP`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `GL_ACCOUNT_CLASS`
--

DROP TABLE IF EXISTS `GL_ACCOUNT_CLASS`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `GL_ACCOUNT_CLASS` (
  `GL_ACCOUNT_CLASS_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARENT_CLASS_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `IS_ASSET_CLASS` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`GL_ACCOUNT_CLASS_ID`),
  KEY `GLACTCLS_PAR` (`PARENT_CLASS_ID`),
  KEY `GL_ACCT_CLS_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `GL_ACCT_CLS_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `GLACTCLS_PAR` FOREIGN KEY (`PARENT_CLASS_ID`) REFERENCES `GL_ACCOUNT_CLASS` (`GL_ACCOUNT_CLASS_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `GL_ACCOUNT_GROUP`
--

DROP TABLE IF EXISTS `GL_ACCOUNT_GROUP`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `GL_ACCOUNT_GROUP` (
  `GL_ACCOUNT_GROUP_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `GL_ACCOUNT_GROUP_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`GL_ACCOUNT_GROUP_ID`),
  KEY `GLACT_GRP_TP` (`GL_ACCOUNT_GROUP_TYPE_ID`),
  KEY `GL_ACCT_GRP_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `GL_ACCT_GRP_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `GLACT_GRP_TP` FOREIGN KEY (`GL_ACCOUNT_GROUP_TYPE_ID`) REFERENCES `GL_ACCOUNT_GROUP_TYPE` (`GL_ACCOUNT_GROUP_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `GL_ACCOUNT_GROUP_MEMBER`
--

DROP TABLE IF EXISTS `GL_ACCOUNT_GROUP_MEMBER`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `GL_ACCOUNT_GROUP_MEMBER` (
  `GL_ACCOUNT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `GL_ACCOUNT_GROUP_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `GL_ACCOUNT_GROUP_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`GL_ACCOUNT_ID`,`GL_ACCOUNT_GROUP_TYPE_ID`),
  KEY `GLACT_GPMBR_AC` (`GL_ACCOUNT_ID`),
  KEY `GLACT_GPMBR_GP` (`GL_ACCOUNT_GROUP_ID`),
  KEY `GLACT_GPMBR_TP` (`GL_ACCOUNT_GROUP_TYPE_ID`),
  KEY `GL_ACT_GRP_MMR_TXP` (`LAST_UPDATED_TX_STAMP`),
  KEY `GL_ACT_GRP_MMR_TXS` (`CREATED_TX_STAMP`),
  CONSTRAINT `GLACT_GPMBR_AC` FOREIGN KEY (`GL_ACCOUNT_ID`) REFERENCES `GL_ACCOUNT` (`GL_ACCOUNT_ID`),
  CONSTRAINT `GLACT_GPMBR_GP` FOREIGN KEY (`GL_ACCOUNT_GROUP_ID`) REFERENCES `GL_ACCOUNT_GROUP` (`GL_ACCOUNT_GROUP_ID`),
  CONSTRAINT `GLACT_GPMBR_TP` FOREIGN KEY (`GL_ACCOUNT_GROUP_TYPE_ID`) REFERENCES `GL_ACCOUNT_GROUP_TYPE` (`GL_ACCOUNT_GROUP_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `GL_ACCOUNT_GROUP_TYPE`
--

DROP TABLE IF EXISTS `GL_ACCOUNT_GROUP_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `GL_ACCOUNT_GROUP_TYPE` (
  `GL_ACCOUNT_GROUP_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`GL_ACCOUNT_GROUP_TYPE_ID`),
  KEY `GL_ACT_GRP_TP_TXSP` (`LAST_UPDATED_TX_STAMP`),
  KEY `GL_ACT_GRP_TP_TXCS` (`CREATED_TX_STAMP`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `GL_ACCOUNT_HISTORY`
--

DROP TABLE IF EXISTS `GL_ACCOUNT_HISTORY`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `GL_ACCOUNT_HISTORY` (
  `GL_ACCOUNT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ORGANIZATION_PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CUSTOM_TIME_PERIOD_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `OPENING_BALANCE` decimal(18,2) DEFAULT NULL,
  `POSTED_DEBITS` decimal(18,2) DEFAULT NULL,
  `POSTED_CREDITS` decimal(18,2) DEFAULT NULL,
  `ENDING_BALANCE` decimal(18,2) DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`GL_ACCOUNT_ID`,`ORGANIZATION_PARTY_ID`,`CUSTOM_TIME_PERIOD_ID`),
  KEY `GLACCT_HST_GLA` (`GL_ACCOUNT_ID`),
  KEY `GLACCT_HST_PARTY` (`ORGANIZATION_PARTY_ID`),
  KEY `GLACCT_HST_CTP` (`CUSTOM_TIME_PERIOD_ID`),
  KEY `GL_ACCT_HSR_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `GL_ACCT_HSR_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `GLACCT_HST_CTP` FOREIGN KEY (`CUSTOM_TIME_PERIOD_ID`) REFERENCES `CUSTOM_TIME_PERIOD` (`CUSTOM_TIME_PERIOD_ID`),
  CONSTRAINT `GLACCT_HST_GLA` FOREIGN KEY (`GL_ACCOUNT_ID`) REFERENCES `GL_ACCOUNT` (`GL_ACCOUNT_ID`),
  CONSTRAINT `GLACCT_HST_PARTY` FOREIGN KEY (`ORGANIZATION_PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `GL_ACCOUNT_ORGANIZATION`
--

DROP TABLE IF EXISTS `GL_ACCOUNT_ORGANIZATION`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `GL_ACCOUNT_ORGANIZATION` (
  `GL_ACCOUNT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ORGANIZATION_PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ROLE_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `FROM_DATE` datetime DEFAULT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`GL_ACCOUNT_ID`,`ORGANIZATION_PARTY_ID`),
  KEY `GLACCT_ORG_GLA` (`GL_ACCOUNT_ID`),
  KEY `GLACCT_ORG_PARTY` (`ORGANIZATION_PARTY_ID`),
  KEY `GL_ACT_ORGNN_TXSTP` (`LAST_UPDATED_TX_STAMP`),
  KEY `GL_ACT_ORGNN_TXCRS` (`CREATED_TX_STAMP`),
  CONSTRAINT `GLACCT_ORG_GLA` FOREIGN KEY (`GL_ACCOUNT_ID`) REFERENCES `GL_ACCOUNT` (`GL_ACCOUNT_ID`),
  CONSTRAINT `GLACCT_ORG_PARTY` FOREIGN KEY (`ORGANIZATION_PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `GL_ACCOUNT_ROLE`
--

DROP TABLE IF EXISTS `GL_ACCOUNT_ROLE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `GL_ACCOUNT_ROLE` (
  `GL_ACCOUNT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ROLE_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FROM_DATE` datetime NOT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`GL_ACCOUNT_ID`,`PARTY_ID`,`ROLE_TYPE_ID`,`FROM_DATE`),
  KEY `GLACCT_RL_GLA` (`GL_ACCOUNT_ID`),
  KEY `GLACCT_RL_PTRLE` (`PARTY_ID`,`ROLE_TYPE_ID`),
  KEY `GL_ACCNT_RL_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `GL_ACCNT_RL_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `GLACCT_RL_GLA` FOREIGN KEY (`GL_ACCOUNT_ID`) REFERENCES `GL_ACCOUNT` (`GL_ACCOUNT_ID`),
  CONSTRAINT `GLACCT_RL_PTRLE` FOREIGN KEY (`PARTY_ID`, `ROLE_TYPE_ID`) REFERENCES `PARTY_ROLE` (`PARTY_ID`, `ROLE_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `GL_ACCOUNT_TYPE`
--

DROP TABLE IF EXISTS `GL_ACCOUNT_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `GL_ACCOUNT_TYPE` (
  `GL_ACCOUNT_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARENT_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `HAS_TABLE` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`GL_ACCOUNT_TYPE_ID`),
  KEY `GLACTTY_PAR` (`PARENT_TYPE_ID`),
  KEY `GL_ACCNT_TP_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `GL_ACCNT_TP_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `GLACTTY_PAR` FOREIGN KEY (`PARENT_TYPE_ID`) REFERENCES `GL_ACCOUNT_TYPE` (`GL_ACCOUNT_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `GL_ACCOUNT_TYPE_DEFAULT`
--

DROP TABLE IF EXISTS `GL_ACCOUNT_TYPE_DEFAULT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `GL_ACCOUNT_TYPE_DEFAULT` (
  `GL_ACCOUNT_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ORGANIZATION_PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `GL_ACCOUNT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`GL_ACCOUNT_TYPE_ID`,`ORGANIZATION_PARTY_ID`),
  KEY `GLACCT_TPDF_GLAT` (`GL_ACCOUNT_TYPE_ID`),
  KEY `GLACCT_TPDF_OPTY` (`ORGANIZATION_PARTY_ID`),
  KEY `GLACCT_TPDF_GLA` (`GL_ACCOUNT_ID`),
  KEY `GL_ACT_TP_DFT_TXSP` (`LAST_UPDATED_TX_STAMP`),
  KEY `GL_ACT_TP_DFT_TXCS` (`CREATED_TX_STAMP`),
  CONSTRAINT `GLACCT_TPDF_GLA` FOREIGN KEY (`GL_ACCOUNT_ID`) REFERENCES `GL_ACCOUNT` (`GL_ACCOUNT_ID`),
  CONSTRAINT `GLACCT_TPDF_GLAT` FOREIGN KEY (`GL_ACCOUNT_TYPE_ID`) REFERENCES `GL_ACCOUNT_TYPE` (`GL_ACCOUNT_TYPE_ID`),
  CONSTRAINT `GLACCT_TPDF_OPTY` FOREIGN KEY (`ORGANIZATION_PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `GL_BUDGET_XREF`
--

DROP TABLE IF EXISTS `GL_BUDGET_XREF`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `GL_BUDGET_XREF` (
  `GL_ACCOUNT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `BUDGET_ITEM_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FROM_DATE` datetime NOT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `ALLOCATION_PERCENTAGE` decimal(18,6) DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`GL_ACCOUNT_ID`,`BUDGET_ITEM_TYPE_ID`,`FROM_DATE`),
  KEY `GL_BDGT_XRF_GLA` (`GL_ACCOUNT_ID`),
  KEY `GL_BDGT_XRF_BIT` (`BUDGET_ITEM_TYPE_ID`),
  KEY `GL_BDGT_XRF_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `GL_BDGT_XRF_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `GL_BDGT_XRF_BIT` FOREIGN KEY (`BUDGET_ITEM_TYPE_ID`) REFERENCES `BUDGET_ITEM_TYPE` (`BUDGET_ITEM_TYPE_ID`),
  CONSTRAINT `GL_BDGT_XRF_GLA` FOREIGN KEY (`GL_ACCOUNT_ID`) REFERENCES `GL_ACCOUNT` (`GL_ACCOUNT_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `GL_FISCAL_TYPE`
--

DROP TABLE IF EXISTS `GL_FISCAL_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `GL_FISCAL_TYPE` (
  `GL_FISCAL_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`GL_FISCAL_TYPE_ID`),
  KEY `GL_FSCL_TP_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `GL_FSCL_TP_TXCRTS` (`CREATED_TX_STAMP`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `GL_JOURNAL`
--

DROP TABLE IF EXISTS `GL_JOURNAL`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `GL_JOURNAL` (
  `GL_JOURNAL_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `GL_JOURNAL_NAME` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `ORGANIZATION_PARTY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `IS_POSTED` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `POSTED_DATE` datetime DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`GL_JOURNAL_ID`),
  KEY `GLJOURN_PARTY` (`ORGANIZATION_PARTY_ID`),
  KEY `GL_JOURNAL_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `GL_JOURNAL_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `GLJOURN_PARTY` FOREIGN KEY (`ORGANIZATION_PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `GL_RECONCILIATION`
--

DROP TABLE IF EXISTS `GL_RECONCILIATION`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `GL_RECONCILIATION` (
  `GL_RECONCILIATION_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `GL_RECONCILIATION_NAME` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `CREATED_DATE` datetime DEFAULT NULL,
  `CREATED_BY_USER_LOGIN` varchar(250) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_MODIFIED_DATE` datetime DEFAULT NULL,
  `LAST_MODIFIED_BY_USER_LOGIN` varchar(250) COLLATE latin1_general_cs DEFAULT NULL,
  `GL_ACCOUNT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `STATUS_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ORGANIZATION_PARTY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `RECONCILED_BALANCE` decimal(18,2) DEFAULT NULL,
  `OPENING_BALANCE` decimal(18,2) DEFAULT NULL,
  `RECONCILED_DATE` datetime DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`GL_RECONCILIATION_ID`),
  KEY `GLREC_GLACCT` (`GL_ACCOUNT_ID`),
  KEY `GLREC_GLPARTY` (`ORGANIZATION_PARTY_ID`),
  KEY `GLREC_STI` (`STATUS_ID`),
  KEY `GL_RCNCLTN_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `GL_RCNCLTN_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `GLREC_GLACCT` FOREIGN KEY (`GL_ACCOUNT_ID`) REFERENCES `GL_ACCOUNT` (`GL_ACCOUNT_ID`),
  CONSTRAINT `GLREC_GLPARTY` FOREIGN KEY (`ORGANIZATION_PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `GLREC_STI` FOREIGN KEY (`STATUS_ID`) REFERENCES `STATUS_ITEM` (`STATUS_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `GL_RECONCILIATION_ENTRY`
--

DROP TABLE IF EXISTS `GL_RECONCILIATION_ENTRY`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `GL_RECONCILIATION_ENTRY` (
  `GL_RECONCILIATION_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ACCTG_TRANS_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ACCTG_TRANS_ENTRY_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `RECONCILED_AMOUNT` decimal(18,2) DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`GL_RECONCILIATION_ID`,`ACCTG_TRANS_ID`,`ACCTG_TRANS_ENTRY_SEQ_ID`),
  KEY `GL_RECENT_GLREC` (`GL_RECONCILIATION_ID`),
  KEY `GL_RECENT_ACTTXE` (`ACCTG_TRANS_ID`,`ACCTG_TRANS_ENTRY_SEQ_ID`),
  KEY `GL_RCNCN_ENR_TXSTP` (`LAST_UPDATED_TX_STAMP`),
  KEY `GL_RCNCN_ENR_TXCRS` (`CREATED_TX_STAMP`),
  CONSTRAINT `GL_RECENT_ACTTXE` FOREIGN KEY (`ACCTG_TRANS_ID`, `ACCTG_TRANS_ENTRY_SEQ_ID`) REFERENCES `ACCTG_TRANS_ENTRY` (`ACCTG_TRANS_ID`, `ACCTG_TRANS_ENTRY_SEQ_ID`),
  CONSTRAINT `GL_RECENT_GLREC` FOREIGN KEY (`GL_RECONCILIATION_ID`) REFERENCES `GL_RECONCILIATION` (`GL_RECONCILIATION_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `GL_RESOURCE_TYPE`
--

DROP TABLE IF EXISTS `GL_RESOURCE_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `GL_RESOURCE_TYPE` (
  `GL_RESOURCE_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`GL_RESOURCE_TYPE_ID`),
  KEY `GL_RSRC_TP_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `GL_RSRC_TP_TXCRTS` (`CREATED_TX_STAMP`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `GL_XBRL_CLASS`
--

DROP TABLE IF EXISTS `GL_XBRL_CLASS`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `GL_XBRL_CLASS` (
  `GL_XBRL_CLASS_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`GL_XBRL_CLASS_ID`),
  KEY `GL_XBRL_CLS_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `GL_XBRL_CLS_TXCRTS` (`CREATED_TX_STAMP`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `GOOD_IDENTIFICATION`
--

DROP TABLE IF EXISTS `GOOD_IDENTIFICATION`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `GOOD_IDENTIFICATION` (
  `GOOD_IDENTIFICATION_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ID_VALUE` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`GOOD_IDENTIFICATION_TYPE_ID`,`PRODUCT_ID`),
  KEY `GOOD_ID_TYPE` (`GOOD_IDENTIFICATION_TYPE_ID`),
  KEY `GOOD_ID_PRODICT` (`PRODUCT_ID`),
  KEY `GD_IDNTFCTN_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `GD_IDNTFCTN_TXCRTS` (`CREATED_TX_STAMP`),
  KEY `GOOD_ID_VALIDX` (`ID_VALUE`),
  CONSTRAINT `GOOD_ID_PRODICT` FOREIGN KEY (`PRODUCT_ID`) REFERENCES `PRODUCT` (`PRODUCT_ID`),
  CONSTRAINT `GOOD_ID_TYPE` FOREIGN KEY (`GOOD_IDENTIFICATION_TYPE_ID`) REFERENCES `GOOD_IDENTIFICATION_TYPE` (`GOOD_IDENTIFICATION_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `GOOD_IDENTIFICATION_TYPE`
--

DROP TABLE IF EXISTS `GOOD_IDENTIFICATION_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `GOOD_IDENTIFICATION_TYPE` (
  `GOOD_IDENTIFICATION_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARENT_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `HAS_TABLE` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`GOOD_IDENTIFICATION_TYPE_ID`),
  KEY `GOOD_ID_TYPE_PAR` (`PARENT_TYPE_ID`),
  KEY `GD_IDNTFN_TP_TXSTP` (`LAST_UPDATED_TX_STAMP`),
  KEY `GD_IDNTFN_TP_TXCRS` (`CREATED_TX_STAMP`),
  CONSTRAINT `GOOD_ID_TYPE_PAR` FOREIGN KEY (`PARENT_TYPE_ID`) REFERENCES `GOOD_IDENTIFICATION_TYPE` (`GOOD_IDENTIFICATION_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `IMAGE_DATA_RESOURCE`
--

DROP TABLE IF EXISTS `IMAGE_DATA_RESOURCE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `IMAGE_DATA_RESOURCE` (
  `DATA_RESOURCE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `IMAGE_DATA` longblob,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`DATA_RESOURCE_ID`),
  KEY `DATA_REC_IMAGE` (`DATA_RESOURCE_ID`),
  KEY `IMG_DT_RSRC_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `IMG_DT_RSRC_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `DATA_REC_IMAGE` FOREIGN KEY (`DATA_RESOURCE_ID`) REFERENCES `DATA_RESOURCE` (`DATA_RESOURCE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `INVENTORY_ITEM`
--

DROP TABLE IF EXISTS `INVENTORY_ITEM`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `INVENTORY_ITEM` (
  `INVENTORY_ITEM_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `INVENTORY_ITEM_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PRODUCT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `OWNER_PARTY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `STATUS_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `DATETIME_RECEIVED` datetime DEFAULT NULL,
  `DATETIME_MANUFACTURED` datetime DEFAULT NULL,
  `EXPIRE_DATE` datetime DEFAULT NULL,
  `FACILITY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `CONTAINER_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `LOT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `UOM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `BIN_NUMBER` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `LOCATION_SEQ_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `COMMENTS` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `QUANTITY_ON_HAND_TOTAL` decimal(18,6) DEFAULT NULL,
  `AVAILABLE_TO_PROMISE_TOTAL` decimal(18,6) DEFAULT NULL,
  `ACCOUNTING_QUANTITY_TOTAL` decimal(18,6) DEFAULT NULL,
  `QUANTITY_ON_HAND` decimal(18,6) DEFAULT NULL,
  `AVAILABLE_TO_PROMISE` decimal(18,6) DEFAULT NULL,
  `SERIAL_NUMBER` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `SOFT_IDENTIFIER` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `ACTIVATION_NUMBER` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `ACTIVATION_VALID_THRU` datetime DEFAULT NULL,
  `UNIT_COST` decimal(18,6) DEFAULT NULL,
  `CURRENCY_UOM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  `FIXED_ASSET_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  PRIMARY KEY (`INVENTORY_ITEM_ID`),
  UNIQUE KEY `INVITEM_SOFID` (`SOFT_IDENTIFIER`),
  UNIQUE KEY `INVITEM_ACTNM` (`ACTIVATION_NUMBER`),
  KEY `INV_ITEM_TYPE` (`INVENTORY_ITEM_TYPE_ID`),
  KEY `INV_ITEM_PRODUCT` (`PRODUCT_ID`),
  KEY `INV_ITEM_PARTY` (`PARTY_ID`),
  KEY `INV_ITEM_OWNPARTY` (`OWNER_PARTY_ID`),
  KEY `INV_ITEM_STTSITM` (`STATUS_ID`),
  KEY `INV_ITEM_FACILITY` (`FACILITY_ID`),
  KEY `INV_ITEM_CONTAINER` (`CONTAINER_ID`),
  KEY `INV_ITEM_LOT` (`LOT_ID`),
  KEY `INV_ITEM_UOM` (`UOM_ID`),
  KEY `INV_ITEM_CUOM` (`CURRENCY_UOM_ID`),
  KEY `IYIM_FAST` (`FIXED_ASSET_ID`),
  KEY `INVNTR_ITM_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `INVNTR_ITM_TXCRTS` (`CREATED_TX_STAMP`),
  KEY `INV_ITEM_SN` (`SERIAL_NUMBER`),
  CONSTRAINT `INV_ITEM_CONTAINER` FOREIGN KEY (`CONTAINER_ID`) REFERENCES `CONTAINER` (`CONTAINER_ID`),
  CONSTRAINT `INV_ITEM_CUOM` FOREIGN KEY (`CURRENCY_UOM_ID`) REFERENCES `UOM` (`UOM_ID`),
  CONSTRAINT `INV_ITEM_FACILITY` FOREIGN KEY (`FACILITY_ID`) REFERENCES `FACILITY` (`FACILITY_ID`),
  CONSTRAINT `INV_ITEM_LOT` FOREIGN KEY (`LOT_ID`) REFERENCES `LOT` (`LOT_ID`),
  CONSTRAINT `INV_ITEM_OWNPARTY` FOREIGN KEY (`OWNER_PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `INV_ITEM_PARTY` FOREIGN KEY (`PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `INV_ITEM_PRODUCT` FOREIGN KEY (`PRODUCT_ID`) REFERENCES `PRODUCT` (`PRODUCT_ID`),
  CONSTRAINT `INV_ITEM_STTSITM` FOREIGN KEY (`STATUS_ID`) REFERENCES `STATUS_ITEM` (`STATUS_ID`),
  CONSTRAINT `INV_ITEM_TYPE` FOREIGN KEY (`INVENTORY_ITEM_TYPE_ID`) REFERENCES `INVENTORY_ITEM_TYPE` (`INVENTORY_ITEM_TYPE_ID`),
  CONSTRAINT `INV_ITEM_UOM` FOREIGN KEY (`UOM_ID`) REFERENCES `UOM` (`UOM_ID`),
  CONSTRAINT `IYIM_FAST` FOREIGN KEY (`FIXED_ASSET_ID`) REFERENCES `FIXED_ASSET` (`FIXED_ASSET_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `INVENTORY_ITEM_ATTRIBUTE`
--

DROP TABLE IF EXISTS `INVENTORY_ITEM_ATTRIBUTE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `INVENTORY_ITEM_ATTRIBUTE` (
  `INVENTORY_ITEM_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ATTR_NAME` varchar(60) COLLATE latin1_general_cs NOT NULL,
  `ATTR_VALUE` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`INVENTORY_ITEM_ID`,`ATTR_NAME`),
  KEY `INV_ITEM_ATTR` (`INVENTORY_ITEM_ID`),
  KEY `INVR_ITM_ATTT_TXSP` (`LAST_UPDATED_TX_STAMP`),
  KEY `INVR_ITM_ATTT_TXCS` (`CREATED_TX_STAMP`),
  CONSTRAINT `INV_ITEM_ATTR` FOREIGN KEY (`INVENTORY_ITEM_ID`) REFERENCES `INVENTORY_ITEM` (`INVENTORY_ITEM_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `INVENTORY_ITEM_DETAIL`
--

DROP TABLE IF EXISTS `INVENTORY_ITEM_DETAIL`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `INVENTORY_ITEM_DETAIL` (
  `INVENTORY_ITEM_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `INVENTORY_ITEM_DETAIL_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `EFFECTIVE_DATE` datetime DEFAULT NULL,
  `QUANTITY_ON_HAND_DIFF` decimal(18,6) DEFAULT NULL,
  `AVAILABLE_TO_PROMISE_DIFF` decimal(18,6) DEFAULT NULL,
  `ACCOUNTING_QUANTITY_DIFF` decimal(18,6) DEFAULT NULL,
  `UNIT_COST` decimal(18,6) DEFAULT NULL,
  `ORDER_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ORDER_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SHIP_GROUP_SEQ_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SHIPMENT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SHIPMENT_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `RETURN_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `RETURN_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `WORK_EFFORT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `FIXED_ASSET_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `MAINT_HIST_SEQ_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ITEM_ISSUANCE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `RECEIPT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PHYSICAL_INVENTORY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `REASON_ENUM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`INVENTORY_ITEM_ID`,`INVENTORY_ITEM_DETAIL_SEQ_ID`),
  KEY `INV_ITDTL_INVIT` (`INVENTORY_ITEM_ID`),
  KEY `INV_ITDTL_WEFF` (`WORK_EFFORT_ID`),
  KEY `INV_ITDTL_FAMNT` (`FIXED_ASSET_ID`,`MAINT_HIST_SEQ_ID`),
  KEY `INV_ITDTL_ITMIS` (`ITEM_ISSUANCE_ID`),
  KEY `INV_ITDTL_SHRCT` (`RECEIPT_ID`),
  KEY `INV_ITDTL_PHINV` (`PHYSICAL_INVENTORY_ID`),
  KEY `INV_ITDTL_REAS` (`REASON_ENUM_ID`),
  KEY `INVR_ITM_DTL_TXSTP` (`LAST_UPDATED_TX_STAMP`),
  KEY `INVR_ITM_DTL_TXCRS` (`CREATED_TX_STAMP`),
  CONSTRAINT `INV_ITDTL_FAMNT` FOREIGN KEY (`FIXED_ASSET_ID`, `MAINT_HIST_SEQ_ID`) REFERENCES `FIXED_ASSET_MAINT` (`FIXED_ASSET_ID`, `MAINT_HIST_SEQ_ID`),
  CONSTRAINT `INV_ITDTL_INVIT` FOREIGN KEY (`INVENTORY_ITEM_ID`) REFERENCES `INVENTORY_ITEM` (`INVENTORY_ITEM_ID`),
  CONSTRAINT `INV_ITDTL_ITMIS` FOREIGN KEY (`ITEM_ISSUANCE_ID`) REFERENCES `ITEM_ISSUANCE` (`ITEM_ISSUANCE_ID`),
  CONSTRAINT `INV_ITDTL_PHINV` FOREIGN KEY (`PHYSICAL_INVENTORY_ID`) REFERENCES `PHYSICAL_INVENTORY` (`PHYSICAL_INVENTORY_ID`),
  CONSTRAINT `INV_ITDTL_REAS` FOREIGN KEY (`REASON_ENUM_ID`) REFERENCES `ENUMERATION` (`ENUM_ID`),
  CONSTRAINT `INV_ITDTL_SHRCT` FOREIGN KEY (`RECEIPT_ID`) REFERENCES `SHIPMENT_RECEIPT` (`RECEIPT_ID`),
  CONSTRAINT `INV_ITDTL_WEFF` FOREIGN KEY (`WORK_EFFORT_ID`) REFERENCES `WORK_EFFORT` (`WORK_EFFORT_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `INVENTORY_ITEM_LABEL`
--

DROP TABLE IF EXISTS `INVENTORY_ITEM_LABEL`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `INVENTORY_ITEM_LABEL` (
  `INVENTORY_ITEM_LABEL_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `INVENTORY_ITEM_LABEL_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`INVENTORY_ITEM_LABEL_ID`),
  KEY `INV_ITLA_TYPE` (`INVENTORY_ITEM_LABEL_TYPE_ID`),
  KEY `INVR_ITM_LBL_TXSTP` (`LAST_UPDATED_TX_STAMP`),
  KEY `INVR_ITM_LBL_TXCRS` (`CREATED_TX_STAMP`),
  CONSTRAINT `INV_ITLA_TYPE` FOREIGN KEY (`INVENTORY_ITEM_LABEL_TYPE_ID`) REFERENCES `INVENTORY_ITEM_LABEL_TYPE` (`INVENTORY_ITEM_LABEL_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `INVENTORY_ITEM_LABEL_APPL`
--

DROP TABLE IF EXISTS `INVENTORY_ITEM_LABEL_APPL`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `INVENTORY_ITEM_LABEL_APPL` (
  `INVENTORY_ITEM_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `INVENTORY_ITEM_LABEL_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `INVENTORY_ITEM_LABEL_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SEQUENCE_NUM` decimal(20,0) DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`INVENTORY_ITEM_ID`,`INVENTORY_ITEM_LABEL_TYPE_ID`),
  KEY `INV_ITLAP_ITEM` (`INVENTORY_ITEM_ID`),
  KEY `INV_ITLAP_TYPE` (`INVENTORY_ITEM_LABEL_TYPE_ID`),
  KEY `INV_ITLAP_LAB` (`INVENTORY_ITEM_LABEL_ID`),
  KEY `INR_ITM_LBL_APL_TP` (`LAST_UPDATED_TX_STAMP`),
  KEY `INR_ITM_LBL_APL_TS` (`CREATED_TX_STAMP`),
  CONSTRAINT `INV_ITLAP_ITEM` FOREIGN KEY (`INVENTORY_ITEM_ID`) REFERENCES `INVENTORY_ITEM` (`INVENTORY_ITEM_ID`),
  CONSTRAINT `INV_ITLAP_LAB` FOREIGN KEY (`INVENTORY_ITEM_LABEL_ID`) REFERENCES `INVENTORY_ITEM_LABEL` (`INVENTORY_ITEM_LABEL_ID`),
  CONSTRAINT `INV_ITLAP_TYPE` FOREIGN KEY (`INVENTORY_ITEM_LABEL_TYPE_ID`) REFERENCES `INVENTORY_ITEM_LABEL_TYPE` (`INVENTORY_ITEM_LABEL_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `INVENTORY_ITEM_LABEL_TYPE`
--

DROP TABLE IF EXISTS `INVENTORY_ITEM_LABEL_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `INVENTORY_ITEM_LABEL_TYPE` (
  `INVENTORY_ITEM_LABEL_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARENT_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `HAS_TABLE` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`INVENTORY_ITEM_LABEL_TYPE_ID`),
  KEY `INV_ITLT_TYPPAR` (`PARENT_TYPE_ID`),
  KEY `INR_ITM_LBL_TP_TXP` (`LAST_UPDATED_TX_STAMP`),
  KEY `INR_ITM_LBL_TP_TXS` (`CREATED_TX_STAMP`),
  CONSTRAINT `INV_ITLT_TYPPAR` FOREIGN KEY (`PARENT_TYPE_ID`) REFERENCES `INVENTORY_ITEM_LABEL_TYPE` (`INVENTORY_ITEM_LABEL_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `INVENTORY_ITEM_STATUS`
--

DROP TABLE IF EXISTS `INVENTORY_ITEM_STATUS`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `INVENTORY_ITEM_STATUS` (
  `INVENTORY_ITEM_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `STATUS_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `STATUS_DATETIME` datetime NOT NULL,
  `STATUS_END_DATETIME` datetime DEFAULT NULL,
  `OWNER_PARTY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PRODUCT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`INVENTORY_ITEM_ID`,`STATUS_ID`,`STATUS_DATETIME`),
  KEY `INV_ITEM_STTS_II` (`INVENTORY_ITEM_ID`),
  KEY `INV_ITEM_STTS_SI` (`STATUS_ID`),
  KEY `INVR_ITM_STS_TXSTP` (`LAST_UPDATED_TX_STAMP`),
  KEY `INVR_ITM_STS_TXCRS` (`CREATED_TX_STAMP`),
  CONSTRAINT `INV_ITEM_STTS_II` FOREIGN KEY (`INVENTORY_ITEM_ID`) REFERENCES `INVENTORY_ITEM` (`INVENTORY_ITEM_ID`),
  CONSTRAINT `INV_ITEM_STTS_SI` FOREIGN KEY (`STATUS_ID`) REFERENCES `STATUS_ITEM` (`STATUS_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `INVENTORY_ITEM_TEMP_RES`
--

DROP TABLE IF EXISTS `INVENTORY_ITEM_TEMP_RES`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `INVENTORY_ITEM_TEMP_RES` (
  `VISIT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_STORE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `QUANTITY` decimal(18,6) DEFAULT NULL,
  `RESERVED_DATE` datetime DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`VISIT_ID`,`PRODUCT_ID`,`PRODUCT_STORE_ID`),
  KEY `INV_ITEM_TR_VIS` (`VISIT_ID`),
  KEY `INV_ITEM_TR_PROD` (`PRODUCT_ID`),
  KEY `INV_ITEM_TR_PRDS` (`PRODUCT_STORE_ID`),
  KEY `INR_ITM_TMP_RS_TXP` (`LAST_UPDATED_TX_STAMP`),
  KEY `INR_ITM_TMP_RS_TXS` (`CREATED_TX_STAMP`),
  CONSTRAINT `INV_ITEM_TR_PRDS` FOREIGN KEY (`PRODUCT_STORE_ID`) REFERENCES `PRODUCT_STORE` (`PRODUCT_STORE_ID`),
  CONSTRAINT `INV_ITEM_TR_PROD` FOREIGN KEY (`PRODUCT_ID`) REFERENCES `PRODUCT` (`PRODUCT_ID`),
  CONSTRAINT `INV_ITEM_TR_VIS` FOREIGN KEY (`VISIT_ID`) REFERENCES `VISIT` (`VISIT_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `INVENTORY_ITEM_TYPE`
--

DROP TABLE IF EXISTS `INVENTORY_ITEM_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `INVENTORY_ITEM_TYPE` (
  `INVENTORY_ITEM_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARENT_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `HAS_TABLE` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`INVENTORY_ITEM_TYPE_ID`),
  KEY `INV_ITEM_TYPPAR` (`PARENT_TYPE_ID`),
  KEY `INVNR_ITM_TP_TXSTP` (`LAST_UPDATED_TX_STAMP`),
  KEY `INVNR_ITM_TP_TXCRS` (`CREATED_TX_STAMP`),
  CONSTRAINT `INV_ITEM_TYPPAR` FOREIGN KEY (`PARENT_TYPE_ID`) REFERENCES `INVENTORY_ITEM_TYPE` (`INVENTORY_ITEM_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `INVENTORY_ITEM_TYPE_ATTR`
--

DROP TABLE IF EXISTS `INVENTORY_ITEM_TYPE_ATTR`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `INVENTORY_ITEM_TYPE_ATTR` (
  `INVENTORY_ITEM_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ATTR_NAME` varchar(60) COLLATE latin1_general_cs NOT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`INVENTORY_ITEM_TYPE_ID`,`ATTR_NAME`),
  KEY `INV_ITEM_TYP_ATTR` (`INVENTORY_ITEM_TYPE_ID`),
  KEY `INR_ITM_TP_ATR_TXP` (`LAST_UPDATED_TX_STAMP`),
  KEY `INR_ITM_TP_ATR_TXS` (`CREATED_TX_STAMP`),
  CONSTRAINT `INV_ITEM_TYP_ATTR` FOREIGN KEY (`INVENTORY_ITEM_TYPE_ID`) REFERENCES `INVENTORY_ITEM_TYPE` (`INVENTORY_ITEM_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `INVENTORY_ITEM_VARIANCE`
--

DROP TABLE IF EXISTS `INVENTORY_ITEM_VARIANCE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `INVENTORY_ITEM_VARIANCE` (
  `INVENTORY_ITEM_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PHYSICAL_INVENTORY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `VARIANCE_REASON_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `AVAILABLE_TO_PROMISE_VAR` decimal(18,6) DEFAULT NULL,
  `QUANTITY_ON_HAND_VAR` decimal(18,6) DEFAULT NULL,
  `COMMENTS` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`INVENTORY_ITEM_ID`,`PHYSICAL_INVENTORY_ID`),
  KEY `INV_ITEM_VAR_PINV` (`PHYSICAL_INVENTORY_ID`),
  KEY `INV_ITEM_VAR_RSN` (`VARIANCE_REASON_ID`),
  KEY `INV_ITEM_VAR_ITEM` (`INVENTORY_ITEM_ID`),
  KEY `INVR_ITM_VRC_TXSTP` (`LAST_UPDATED_TX_STAMP`),
  KEY `INVR_ITM_VRC_TXCRS` (`CREATED_TX_STAMP`),
  CONSTRAINT `INV_ITEM_VAR_ITEM` FOREIGN KEY (`INVENTORY_ITEM_ID`) REFERENCES `INVENTORY_ITEM` (`INVENTORY_ITEM_ID`),
  CONSTRAINT `INV_ITEM_VAR_PINV` FOREIGN KEY (`PHYSICAL_INVENTORY_ID`) REFERENCES `PHYSICAL_INVENTORY` (`PHYSICAL_INVENTORY_ID`),
  CONSTRAINT `INV_ITEM_VAR_RSN` FOREIGN KEY (`VARIANCE_REASON_ID`) REFERENCES `VARIANCE_REASON` (`VARIANCE_REASON_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `INVENTORY_TRANSFER`
--

DROP TABLE IF EXISTS `INVENTORY_TRANSFER`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `INVENTORY_TRANSFER` (
  `INVENTORY_TRANSFER_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `STATUS_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `INVENTORY_ITEM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `FACILITY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `LOCATION_SEQ_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `CONTAINER_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `FACILITY_ID_TO` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `LOCATION_SEQ_ID_TO` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `CONTAINER_ID_TO` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ITEM_ISSUANCE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SEND_DATE` datetime DEFAULT NULL,
  `RECEIVE_DATE` datetime DEFAULT NULL,
  `COMMENTS` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`INVENTORY_TRANSFER_ID`),
  KEY `INV_XFER_ITEM` (`INVENTORY_ITEM_ID`),
  KEY `INV_XFER_STTS` (`STATUS_ID`),
  KEY `INV_XFER_FAC` (`FACILITY_ID`),
  KEY `INV_XFER_CONT` (`CONTAINER_ID`),
  KEY `INV_XFER_TFAC` (`FACILITY_ID_TO`),
  KEY `INV_XFER_TCNT` (`CONTAINER_ID_TO`),
  KEY `INV_XFER_ISSU` (`ITEM_ISSUANCE_ID`),
  KEY `INVNR_TRNSR_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `INVNR_TRNSR_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `INV_XFER_CONT` FOREIGN KEY (`CONTAINER_ID`) REFERENCES `CONTAINER` (`CONTAINER_ID`),
  CONSTRAINT `INV_XFER_FAC` FOREIGN KEY (`FACILITY_ID`) REFERENCES `FACILITY` (`FACILITY_ID`),
  CONSTRAINT `INV_XFER_ISSU` FOREIGN KEY (`ITEM_ISSUANCE_ID`) REFERENCES `ITEM_ISSUANCE` (`ITEM_ISSUANCE_ID`),
  CONSTRAINT `INV_XFER_ITEM` FOREIGN KEY (`INVENTORY_ITEM_ID`) REFERENCES `INVENTORY_ITEM` (`INVENTORY_ITEM_ID`),
  CONSTRAINT `INV_XFER_STTS` FOREIGN KEY (`STATUS_ID`) REFERENCES `STATUS_ITEM` (`STATUS_ID`),
  CONSTRAINT `INV_XFER_TCNT` FOREIGN KEY (`CONTAINER_ID_TO`) REFERENCES `CONTAINER` (`CONTAINER_ID`),
  CONSTRAINT `INV_XFER_TFAC` FOREIGN KEY (`FACILITY_ID_TO`) REFERENCES `FACILITY` (`FACILITY_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `INVOICE`
--

DROP TABLE IF EXISTS `INVOICE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `INVOICE` (
  `INVOICE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `INVOICE_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PARTY_ID_FROM` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ROLE_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `STATUS_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `BILLING_ACCOUNT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `CONTACT_MECH_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `INVOICE_DATE` datetime DEFAULT NULL,
  `DUE_DATE` datetime DEFAULT NULL,
  `PAID_DATE` datetime DEFAULT NULL,
  `INVOICE_MESSAGE` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `REFERENCE_NUMBER` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `CURRENCY_UOM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `RECURRENCE_INFO_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`INVOICE_ID`),
  KEY `INVOICE_INVTYP` (`INVOICE_TYPE_ID`),
  KEY `INVOICE_PARTY_FRM` (`PARTY_ID_FROM`),
  KEY `INVOICE_PARTY` (`PARTY_ID`),
  KEY `INVOICE_ROLETYP` (`ROLE_TYPE_ID`),
  KEY `INVOICE_STTSITM` (`STATUS_ID`),
  KEY `INVOICE_BILLACCT` (`BILLING_ACCOUNT_ID`),
  KEY `INVOICE_CMECH` (`CONTACT_MECH_ID`),
  KEY `INVOICE_CUOM` (`CURRENCY_UOM_ID`),
  KEY `INVOICE_RECINFO` (`RECURRENCE_INFO_ID`),
  KEY `INVOICE_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `INVOICE_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `INVOICE_BILLACCT` FOREIGN KEY (`BILLING_ACCOUNT_ID`) REFERENCES `BILLING_ACCOUNT` (`BILLING_ACCOUNT_ID`),
  CONSTRAINT `INVOICE_CMECH` FOREIGN KEY (`CONTACT_MECH_ID`) REFERENCES `CONTACT_MECH` (`CONTACT_MECH_ID`),
  CONSTRAINT `INVOICE_CUOM` FOREIGN KEY (`CURRENCY_UOM_ID`) REFERENCES `UOM` (`UOM_ID`),
  CONSTRAINT `INVOICE_INVTYP` FOREIGN KEY (`INVOICE_TYPE_ID`) REFERENCES `INVOICE_TYPE` (`INVOICE_TYPE_ID`),
  CONSTRAINT `INVOICE_PARTY` FOREIGN KEY (`PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `INVOICE_PARTY_FRM` FOREIGN KEY (`PARTY_ID_FROM`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `INVOICE_RECINFO` FOREIGN KEY (`RECURRENCE_INFO_ID`) REFERENCES `RECURRENCE_INFO` (`RECURRENCE_INFO_ID`),
  CONSTRAINT `INVOICE_ROLETYP` FOREIGN KEY (`ROLE_TYPE_ID`) REFERENCES `ROLE_TYPE` (`ROLE_TYPE_ID`),
  CONSTRAINT `INVOICE_STTSITM` FOREIGN KEY (`STATUS_ID`) REFERENCES `STATUS_ITEM` (`STATUS_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `INVOICE_ATTRIBUTE`
--

DROP TABLE IF EXISTS `INVOICE_ATTRIBUTE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `INVOICE_ATTRIBUTE` (
  `INVOICE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ATTR_NAME` varchar(60) COLLATE latin1_general_cs NOT NULL,
  `ATTR_VALUE` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`INVOICE_ID`,`ATTR_NAME`),
  KEY `INVOICE_ATTR` (`INVOICE_ID`),
  KEY `INVC_ATTRBT_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `INVC_ATTRBT_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `INVOICE_ATTR` FOREIGN KEY (`INVOICE_ID`) REFERENCES `INVOICE` (`INVOICE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `INVOICE_CONTACT_MECH`
--

DROP TABLE IF EXISTS `INVOICE_CONTACT_MECH`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `INVOICE_CONTACT_MECH` (
  `INVOICE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CONTACT_MECH_PURPOSE_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CONTACT_MECH_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`INVOICE_ID`,`CONTACT_MECH_PURPOSE_TYPE_ID`,`CONTACT_MECH_ID`),
  KEY `INVOICE_CMECH_HDR` (`INVOICE_ID`),
  KEY `INVOICE_CMECH_CM` (`CONTACT_MECH_ID`),
  KEY `INVOICE_CMECH_CMPT` (`CONTACT_MECH_PURPOSE_TYPE_ID`),
  KEY `INC_CNTT_MCH_TXSTP` (`LAST_UPDATED_TX_STAMP`),
  KEY `INC_CNTT_MCH_TXCRS` (`CREATED_TX_STAMP`),
  CONSTRAINT `INVOICE_CMECH_CM` FOREIGN KEY (`CONTACT_MECH_ID`) REFERENCES `CONTACT_MECH` (`CONTACT_MECH_ID`),
  CONSTRAINT `INVOICE_CMECH_CMPT` FOREIGN KEY (`CONTACT_MECH_PURPOSE_TYPE_ID`) REFERENCES `CONTACT_MECH_PURPOSE_TYPE` (`CONTACT_MECH_PURPOSE_TYPE_ID`),
  CONSTRAINT `INVOICE_CMECH_HDR` FOREIGN KEY (`INVOICE_ID`) REFERENCES `INVOICE` (`INVOICE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `INVOICE_CONTENT`
--

DROP TABLE IF EXISTS `INVOICE_CONTENT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `INVOICE_CONTENT` (
  `INVOICE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `INVOICE_CONTENT_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CONTENT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FROM_DATE` datetime NOT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`CONTENT_ID`,`INVOICE_ID`,`INVOICE_CONTENT_TYPE_ID`,`FROM_DATE`),
  KEY `INV_CNT_PROD` (`INVOICE_ID`),
  KEY `INV_CNT_CNT` (`CONTENT_ID`),
  KEY `INV_CNT_TYPE` (`INVOICE_CONTENT_TYPE_ID`),
  KEY `INVC_CNTNT_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `INVC_CNTNT_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `INV_CNT_CNT` FOREIGN KEY (`CONTENT_ID`) REFERENCES `CONTENT` (`CONTENT_ID`),
  CONSTRAINT `INV_CNT_PROD` FOREIGN KEY (`INVOICE_ID`) REFERENCES `INVOICE` (`INVOICE_ID`),
  CONSTRAINT `INV_CNT_TYPE` FOREIGN KEY (`INVOICE_CONTENT_TYPE_ID`) REFERENCES `INVOICE_CONTENT_TYPE` (`INVOICE_CONTENT_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `INVOICE_CONTENT_TYPE`
--

DROP TABLE IF EXISTS `INVOICE_CONTENT_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `INVOICE_CONTENT_TYPE` (
  `INVOICE_CONTENT_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARENT_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `HAS_TABLE` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`INVOICE_CONTENT_TYPE_ID`),
  KEY `INVCT_TYP_PARENT` (`PARENT_TYPE_ID`),
  KEY `INC_CNTT_TP_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `INC_CNTT_TP_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `INVCT_TYP_PARENT` FOREIGN KEY (`PARENT_TYPE_ID`) REFERENCES `INVOICE_CONTENT_TYPE` (`INVOICE_CONTENT_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `INVOICE_ITEM`
--

DROP TABLE IF EXISTS `INVOICE_ITEM`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `INVOICE_ITEM` (
  `INVOICE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `INVOICE_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `INVOICE_ITEM_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `OVERRIDE_GL_ACCOUNT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `OVERRIDE_ORG_PARTY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `INVENTORY_ITEM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PRODUCT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PRODUCT_FEATURE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PARENT_INVOICE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PARENT_INVOICE_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `UOM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `TAXABLE_FLAG` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `QUANTITY` decimal(18,6) DEFAULT NULL,
  `AMOUNT` decimal(18,3) DEFAULT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `TAX_AUTH_PARTY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `TAX_AUTH_GEO_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `TAX_AUTHORITY_RATE_SEQ_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SALES_OPPORTUNITY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`INVOICE_ID`,`INVOICE_ITEM_SEQ_ID`),
  KEY `INVOICE_ITMITYP` (`INVOICE_ITEM_TYPE_ID`),
  KEY `INVCE_ITM_INVCE` (`INVOICE_ID`),
  KEY `INVCE_ITM_INVITM` (`INVENTORY_ITEM_ID`),
  KEY `INVCE_ITM_PROD` (`PRODUCT_ID`),
  KEY `INVCE_ITM_PRDFT` (`PRODUCT_FEATURE_ID`),
  KEY `INVCE_ITM_PINVIT` (`PARENT_INVOICE_ID`,`PARENT_INVOICE_ITEM_SEQ_ID`),
  KEY `INVCE_ITM_UOM` (`UOM_ID`),
  KEY `INVCE_ITM_ORGLA` (`OVERRIDE_GL_ACCOUNT_ID`),
  KEY `INVCE_ITM_TAXPTY` (`TAX_AUTH_PARTY_ID`),
  KEY `INVCE_ITM_TAXGEO` (`TAX_AUTH_GEO_ID`),
  KEY `INVOICE_ITM_TARP` (`TAX_AUTHORITY_RATE_SEQ_ID`),
  KEY `INVCE_ITM_OVRPTY` (`OVERRIDE_ORG_PARTY_ID`),
  KEY `INVCE_ITM_SLSOPP` (`SALES_OPPORTUNITY_ID`),
  KEY `INVC_ITM_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `INVC_ITM_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `INVCE_ITM_INVCE` FOREIGN KEY (`INVOICE_ID`) REFERENCES `INVOICE` (`INVOICE_ID`),
  CONSTRAINT `INVCE_ITM_INVITM` FOREIGN KEY (`INVENTORY_ITEM_ID`) REFERENCES `INVENTORY_ITEM` (`INVENTORY_ITEM_ID`),
  CONSTRAINT `INVCE_ITM_ORGLA` FOREIGN KEY (`OVERRIDE_GL_ACCOUNT_ID`) REFERENCES `GL_ACCOUNT` (`GL_ACCOUNT_ID`),
  CONSTRAINT `INVCE_ITM_OVRPTY` FOREIGN KEY (`OVERRIDE_ORG_PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `INVCE_ITM_PINVIT` FOREIGN KEY (`PARENT_INVOICE_ID`, `PARENT_INVOICE_ITEM_SEQ_ID`) REFERENCES `INVOICE_ITEM` (`INVOICE_ID`, `INVOICE_ITEM_SEQ_ID`),
  CONSTRAINT `INVCE_ITM_PRDFT` FOREIGN KEY (`PRODUCT_FEATURE_ID`) REFERENCES `PRODUCT_FEATURE` (`PRODUCT_FEATURE_ID`),
  CONSTRAINT `INVCE_ITM_PROD` FOREIGN KEY (`PRODUCT_ID`) REFERENCES `PRODUCT` (`PRODUCT_ID`),
  CONSTRAINT `INVCE_ITM_SLSOPP` FOREIGN KEY (`SALES_OPPORTUNITY_ID`) REFERENCES `SALES_OPPORTUNITY` (`SALES_OPPORTUNITY_ID`),
  CONSTRAINT `INVCE_ITM_TAXGEO` FOREIGN KEY (`TAX_AUTH_GEO_ID`) REFERENCES `GEO` (`GEO_ID`),
  CONSTRAINT `INVCE_ITM_TAXPTY` FOREIGN KEY (`TAX_AUTH_PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `INVCE_ITM_UOM` FOREIGN KEY (`UOM_ID`) REFERENCES `UOM` (`UOM_ID`),
  CONSTRAINT `INVOICE_ITMITYP` FOREIGN KEY (`INVOICE_ITEM_TYPE_ID`) REFERENCES `INVOICE_ITEM_TYPE` (`INVOICE_ITEM_TYPE_ID`),
  CONSTRAINT `INVOICE_ITM_TARP` FOREIGN KEY (`TAX_AUTHORITY_RATE_SEQ_ID`) REFERENCES `TAX_AUTHORITY_RATE_PRODUCT` (`TAX_AUTHORITY_RATE_SEQ_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `INVOICE_ITEM_ASSOC`
--

DROP TABLE IF EXISTS `INVOICE_ITEM_ASSOC`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `INVOICE_ITEM_ASSOC` (
  `INVOICE_ID_FROM` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `INVOICE_ITEM_SEQ_ID_FROM` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `INVOICE_ID_TO` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `INVOICE_ITEM_SEQ_ID_TO` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `INVOICE_ITEM_ASSOC_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FROM_DATE` datetime NOT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `PARTY_ID_FROM` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PARTY_ID_TO` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `QUANTITY` decimal(18,6) DEFAULT NULL,
  `AMOUNT` decimal(18,2) DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`INVOICE_ID_FROM`,`INVOICE_ITEM_SEQ_ID_FROM`,`INVOICE_ID_TO`,`INVOICE_ITEM_SEQ_ID_TO`,`INVOICE_ITEM_ASSOC_TYPE_ID`,`FROM_DATE`),
  KEY `INITMASCTYP_IIASC` (`INVOICE_ITEM_ASSOC_TYPE_ID`),
  KEY `INITMASC_FIITM` (`INVOICE_ID_FROM`,`INVOICE_ITEM_SEQ_ID_FROM`),
  KEY `INITMASC_TIITM` (`INVOICE_ID_TO`,`INVOICE_ITEM_SEQ_ID_TO`),
  KEY `INC_ITM_ASC_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `INC_ITM_ASC_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `INITMASCTYP_IIASC` FOREIGN KEY (`INVOICE_ITEM_ASSOC_TYPE_ID`) REFERENCES `INVOICE_ITEM_ASSOC_TYPE` (`INVOICE_ITEM_ASSOC_TYPE_ID`),
  CONSTRAINT `INITMASC_FIITM` FOREIGN KEY (`INVOICE_ID_FROM`, `INVOICE_ITEM_SEQ_ID_FROM`) REFERENCES `INVOICE_ITEM` (`INVOICE_ID`, `INVOICE_ITEM_SEQ_ID`),
  CONSTRAINT `INITMASC_TIITM` FOREIGN KEY (`INVOICE_ID_TO`, `INVOICE_ITEM_SEQ_ID_TO`) REFERENCES `INVOICE_ITEM` (`INVOICE_ID`, `INVOICE_ITEM_SEQ_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `INVOICE_ITEM_ASSOC_TYPE`
--

DROP TABLE IF EXISTS `INVOICE_ITEM_ASSOC_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `INVOICE_ITEM_ASSOC_TYPE` (
  `INVOICE_ITEM_ASSOC_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARENT_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `HAS_TABLE` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`INVOICE_ITEM_ASSOC_TYPE_ID`),
  KEY `INITMASCTYP_PRNT` (`PARENT_TYPE_ID`),
  KEY `INC_ITM_ASC_TP_TXP` (`LAST_UPDATED_TX_STAMP`),
  KEY `INC_ITM_ASC_TP_TXS` (`CREATED_TX_STAMP`),
  CONSTRAINT `INITMASCTYP_PRNT` FOREIGN KEY (`PARENT_TYPE_ID`) REFERENCES `INVOICE_ITEM_ASSOC_TYPE` (`INVOICE_ITEM_ASSOC_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `INVOICE_ITEM_ATTRIBUTE`
--

DROP TABLE IF EXISTS `INVOICE_ITEM_ATTRIBUTE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `INVOICE_ITEM_ATTRIBUTE` (
  `INVOICE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `INVOICE_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ATTR_NAME` varchar(60) COLLATE latin1_general_cs NOT NULL,
  `ATTR_VALUE` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`INVOICE_ID`,`INVOICE_ITEM_SEQ_ID`,`ATTR_NAME`),
  KEY `INVOICE_IMAT_ITM` (`INVOICE_ID`,`INVOICE_ITEM_SEQ_ID`),
  KEY `INC_ITM_ATTT_TXSTP` (`LAST_UPDATED_TX_STAMP`),
  KEY `INC_ITM_ATTT_TXCRS` (`CREATED_TX_STAMP`),
  CONSTRAINT `INVOICE_IMAT_ITM` FOREIGN KEY (`INVOICE_ID`, `INVOICE_ITEM_SEQ_ID`) REFERENCES `INVOICE_ITEM` (`INVOICE_ID`, `INVOICE_ITEM_SEQ_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `INVOICE_ITEM_TYPE`
--

DROP TABLE IF EXISTS `INVOICE_ITEM_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `INVOICE_ITEM_TYPE` (
  `INVOICE_ITEM_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARENT_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `HAS_TABLE` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `DEFAULT_GL_ACCOUNT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`INVOICE_ITEM_TYPE_ID`),
  KEY `INVOICE_ITEM_TPAR` (`PARENT_TYPE_ID`),
  KEY `INVOICE_ITM_DGLAC` (`DEFAULT_GL_ACCOUNT_ID`),
  KEY `INVC_ITM_TP_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `INVC_ITM_TP_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `INVOICE_ITEM_TPAR` FOREIGN KEY (`PARENT_TYPE_ID`) REFERENCES `INVOICE_ITEM_TYPE` (`INVOICE_ITEM_TYPE_ID`),
  CONSTRAINT `INVOICE_ITM_DGLAC` FOREIGN KEY (`DEFAULT_GL_ACCOUNT_ID`) REFERENCES `GL_ACCOUNT` (`GL_ACCOUNT_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `INVOICE_ITEM_TYPE_ATTR`
--

DROP TABLE IF EXISTS `INVOICE_ITEM_TYPE_ATTR`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `INVOICE_ITEM_TYPE_ATTR` (
  `INVOICE_ITEM_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ATTR_NAME` varchar(60) COLLATE latin1_general_cs NOT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`INVOICE_ITEM_TYPE_ID`,`ATTR_NAME`),
  KEY `INVOICE_ITEM_TATR` (`INVOICE_ITEM_TYPE_ID`),
  KEY `INC_ITM_TP_ATR_TXP` (`LAST_UPDATED_TX_STAMP`),
  KEY `INC_ITM_TP_ATR_TXS` (`CREATED_TX_STAMP`),
  CONSTRAINT `INVOICE_ITEM_TATR` FOREIGN KEY (`INVOICE_ITEM_TYPE_ID`) REFERENCES `INVOICE_ITEM_TYPE` (`INVOICE_ITEM_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `INVOICE_ITEM_TYPE_GL_ACCOUNT`
--

DROP TABLE IF EXISTS `INVOICE_ITEM_TYPE_GL_ACCOUNT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `INVOICE_ITEM_TYPE_GL_ACCOUNT` (
  `INVOICE_ITEM_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ORGANIZATION_PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `GL_ACCOUNT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`INVOICE_ITEM_TYPE_ID`,`ORGANIZATION_PARTY_ID`),
  KEY `INVOICE_ITGA_IIT` (`INVOICE_ITEM_TYPE_ID`),
  KEY `INVOICE_ITGA_OPTY` (`ORGANIZATION_PARTY_ID`),
  KEY `INVOICE_ITGA_GLAC` (`GL_ACCOUNT_ID`),
  KEY `INC_TP_GL_ACT_TP` (`LAST_UPDATED_TX_STAMP`),
  KEY `INC_TP_GL_ACT_TS` (`CREATED_TX_STAMP`),
  CONSTRAINT `INVOICE_ITGA_GLAC` FOREIGN KEY (`GL_ACCOUNT_ID`) REFERENCES `GL_ACCOUNT` (`GL_ACCOUNT_ID`),
  CONSTRAINT `INVOICE_ITGA_IIT` FOREIGN KEY (`INVOICE_ITEM_TYPE_ID`) REFERENCES `INVOICE_ITEM_TYPE` (`INVOICE_ITEM_TYPE_ID`),
  CONSTRAINT `INVOICE_ITGA_OPTY` FOREIGN KEY (`ORGANIZATION_PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `INVOICE_ITEM_TYPE_MAP`
--

DROP TABLE IF EXISTS `INVOICE_ITEM_TYPE_MAP`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `INVOICE_ITEM_TYPE_MAP` (
  `INVOICE_ITEM_MAP_KEY` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `INVOICE_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `INVOICE_ITEM_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`INVOICE_ITEM_MAP_KEY`,`INVOICE_TYPE_ID`),
  KEY `INVOICE_ITEM_MAP` (`INVOICE_ITEM_TYPE_ID`),
  KEY `INVITMMAP_INVTYP` (`INVOICE_TYPE_ID`),
  KEY `INC_ITM_TP_MP_TXSP` (`LAST_UPDATED_TX_STAMP`),
  KEY `INC_ITM_TP_MP_TXCS` (`CREATED_TX_STAMP`),
  CONSTRAINT `INVITMMAP_INVTYP` FOREIGN KEY (`INVOICE_TYPE_ID`) REFERENCES `INVOICE_TYPE` (`INVOICE_TYPE_ID`),
  CONSTRAINT `INVOICE_ITEM_MAP` FOREIGN KEY (`INVOICE_ITEM_TYPE_ID`) REFERENCES `INVOICE_ITEM_TYPE` (`INVOICE_ITEM_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `INVOICE_NOTE`
--

DROP TABLE IF EXISTS `INVOICE_NOTE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `INVOICE_NOTE` (
  `INVOICE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `NOTE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`INVOICE_ID`,`NOTE_ID`),
  KEY `INVOICE_NOTE_INV` (`INVOICE_ID`),
  KEY `INVOICE_NOTE_NOTE` (`NOTE_ID`),
  KEY `INVC_NT_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `INVC_NT_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `INVOICE_NOTE_INV` FOREIGN KEY (`INVOICE_ID`) REFERENCES `INVOICE` (`INVOICE_ID`),
  CONSTRAINT `INVOICE_NOTE_NOTE` FOREIGN KEY (`NOTE_ID`) REFERENCES `NOTE_DATA` (`NOTE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `INVOICE_ROLE`
--

DROP TABLE IF EXISTS `INVOICE_ROLE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `INVOICE_ROLE` (
  `INVOICE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ROLE_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `DATETIME_PERFORMED` datetime DEFAULT NULL,
  `PERCENTAGE` decimal(18,6) DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`INVOICE_ID`,`PARTY_ID`,`ROLE_TYPE_ID`),
  KEY `INVCE_RLE_INVCE` (`INVOICE_ID`),
  KEY `INVCE_RLE_PARTY` (`PARTY_ID`),
  KEY `INVCE_RLE_PTRL` (`PARTY_ID`,`ROLE_TYPE_ID`),
  KEY `INVC_RL_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `INVC_RL_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `INVCE_RLE_INVCE` FOREIGN KEY (`INVOICE_ID`) REFERENCES `INVOICE` (`INVOICE_ID`),
  CONSTRAINT `INVCE_RLE_PARTY` FOREIGN KEY (`PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `INVCE_RLE_PTRL` FOREIGN KEY (`PARTY_ID`, `ROLE_TYPE_ID`) REFERENCES `PARTY_ROLE` (`PARTY_ID`, `ROLE_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `INVOICE_STATUS`
--

DROP TABLE IF EXISTS `INVOICE_STATUS`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `INVOICE_STATUS` (
  `STATUS_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `INVOICE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `STATUS_DATE` datetime NOT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`STATUS_ID`,`INVOICE_ID`,`STATUS_DATE`),
  KEY `INVCE_STS_STSITM` (`STATUS_ID`),
  KEY `INVCE_STS_INVCE` (`INVOICE_ID`),
  KEY `INVC_STTS_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `INVC_STTS_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `INVCE_STS_INVCE` FOREIGN KEY (`INVOICE_ID`) REFERENCES `INVOICE` (`INVOICE_ID`),
  CONSTRAINT `INVCE_STS_STSITM` FOREIGN KEY (`STATUS_ID`) REFERENCES `STATUS_ITEM` (`STATUS_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `INVOICE_TERM`
--

DROP TABLE IF EXISTS `INVOICE_TERM`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `INVOICE_TERM` (
  `INVOICE_TERM_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `TERM_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `INVOICE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `INVOICE_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `TERM_VALUE` decimal(18,2) DEFAULT NULL,
  `TERM_DAYS` decimal(20,0) DEFAULT NULL,
  `TEXT_VALUE` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `UOM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`INVOICE_TERM_ID`),
  KEY `INVCE_TRM_TRM` (`TERM_TYPE_ID`),
  KEY `INVCE_TRM_INVCE` (`INVOICE_ID`),
  KEY `INVC_TRM_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `INVC_TRM_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `INVCE_TRM_INVCE` FOREIGN KEY (`INVOICE_ID`) REFERENCES `INVOICE` (`INVOICE_ID`),
  CONSTRAINT `INVCE_TRM_TRM` FOREIGN KEY (`TERM_TYPE_ID`) REFERENCES `TERM_TYPE` (`TERM_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `INVOICE_TERM_ATTRIBUTE`
--

DROP TABLE IF EXISTS `INVOICE_TERM_ATTRIBUTE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `INVOICE_TERM_ATTRIBUTE` (
  `INVOICE_TERM_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ATTR_NAME` varchar(60) COLLATE latin1_general_cs NOT NULL,
  `ATTR_VALUE` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`INVOICE_TERM_ID`,`ATTR_NAME`),
  KEY `INVOICE_TRM_ATTR` (`INVOICE_TERM_ID`),
  KEY `INC_TRM_ATTT_TXSTP` (`LAST_UPDATED_TX_STAMP`),
  KEY `INC_TRM_ATTT_TXCRS` (`CREATED_TX_STAMP`),
  CONSTRAINT `INVOICE_TRM_ATTR` FOREIGN KEY (`INVOICE_TERM_ID`) REFERENCES `INVOICE_TERM` (`INVOICE_TERM_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `INVOICE_TYPE`
--

DROP TABLE IF EXISTS `INVOICE_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `INVOICE_TYPE` (
  `INVOICE_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARENT_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `HAS_TABLE` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`INVOICE_TYPE_ID`),
  KEY `INVOICE_TYPE_PAR` (`PARENT_TYPE_ID`),
  KEY `INVC_TP_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `INVC_TP_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `INVOICE_TYPE_PAR` FOREIGN KEY (`PARENT_TYPE_ID`) REFERENCES `INVOICE_TYPE` (`INVOICE_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `INVOICE_TYPE_ATTR`
--

DROP TABLE IF EXISTS `INVOICE_TYPE_ATTR`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `INVOICE_TYPE_ATTR` (
  `INVOICE_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ATTR_NAME` varchar(60) COLLATE latin1_general_cs NOT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`INVOICE_TYPE_ID`,`ATTR_NAME`),
  KEY `INVOICE_TPAT_TYP` (`INVOICE_TYPE_ID`),
  KEY `INVC_TP_ATR_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `INVC_TP_ATR_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `INVOICE_TPAT_TYP` FOREIGN KEY (`INVOICE_TYPE_ID`) REFERENCES `INVOICE_TYPE` (`INVOICE_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ITEM_ISSUANCE`
--

DROP TABLE IF EXISTS `ITEM_ISSUANCE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ITEM_ISSUANCE` (
  `ITEM_ISSUANCE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ORDER_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ORDER_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SHIP_GROUP_SEQ_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `INVENTORY_ITEM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SHIPMENT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SHIPMENT_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `FIXED_ASSET_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `MAINT_HIST_SEQ_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ISSUED_DATE_TIME` datetime DEFAULT NULL,
  `ISSUED_BY_USER_LOGIN_ID` varchar(250) COLLATE latin1_general_cs DEFAULT NULL,
  `QUANTITY` decimal(18,6) DEFAULT NULL,
  `CANCEL_QUANTITY` decimal(18,6) DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`ITEM_ISSUANCE_ID`),
  KEY `ITEM_ISS_INVITM` (`INVENTORY_ITEM_ID`),
  KEY `ITEM_ISS_SHITM` (`SHIPMENT_ID`,`SHIPMENT_ITEM_SEQ_ID`),
  KEY `ITEM_ISS_FAMNT` (`FIXED_ASSET_ID`,`MAINT_HIST_SEQ_ID`),
  KEY `ITEM_ISS_ORITM` (`ORDER_ID`,`ORDER_ITEM_SEQ_ID`),
  KEY `ITEM_ISS_IBUL` (`ISSUED_BY_USER_LOGIN_ID`),
  KEY `ITM_ISSNC_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `ITM_ISSNC_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `ITEM_ISS_FAMNT` FOREIGN KEY (`FIXED_ASSET_ID`, `MAINT_HIST_SEQ_ID`) REFERENCES `FIXED_ASSET_MAINT` (`FIXED_ASSET_ID`, `MAINT_HIST_SEQ_ID`),
  CONSTRAINT `ITEM_ISS_IBUL` FOREIGN KEY (`ISSUED_BY_USER_LOGIN_ID`) REFERENCES `USER_LOGIN` (`USER_LOGIN_ID`),
  CONSTRAINT `ITEM_ISS_INVITM` FOREIGN KEY (`INVENTORY_ITEM_ID`) REFERENCES `INVENTORY_ITEM` (`INVENTORY_ITEM_ID`),
  CONSTRAINT `ITEM_ISS_ORITM` FOREIGN KEY (`ORDER_ID`, `ORDER_ITEM_SEQ_ID`) REFERENCES `ORDER_ITEM` (`ORDER_ID`, `ORDER_ITEM_SEQ_ID`),
  CONSTRAINT `ITEM_ISS_SHITM` FOREIGN KEY (`SHIPMENT_ID`, `SHIPMENT_ITEM_SEQ_ID`) REFERENCES `SHIPMENT_ITEM` (`SHIPMENT_ID`, `SHIPMENT_ITEM_SEQ_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ITEM_ISSUANCE_ROLE`
--

DROP TABLE IF EXISTS `ITEM_ISSUANCE_ROLE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ITEM_ISSUANCE_ROLE` (
  `ITEM_ISSUANCE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ROLE_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`ITEM_ISSUANCE_ID`,`PARTY_ID`,`ROLE_TYPE_ID`),
  KEY `ITEM_ISSRL_ITMIS` (`ITEM_ISSUANCE_ID`),
  KEY `ITEM_ISSRL_PTY` (`PARTY_ID`),
  KEY `ITEM_ISSRL_PTRL` (`PARTY_ID`,`ROLE_TYPE_ID`),
  KEY `ITM_ISSC_RL_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `ITM_ISSC_RL_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `ITEM_ISSRL_ITMIS` FOREIGN KEY (`ITEM_ISSUANCE_ID`) REFERENCES `ITEM_ISSUANCE` (`ITEM_ISSUANCE_ID`),
  CONSTRAINT `ITEM_ISSRL_PTRL` FOREIGN KEY (`PARTY_ID`, `ROLE_TYPE_ID`) REFERENCES `PARTY_ROLE` (`PARTY_ID`, `ROLE_TYPE_ID`),
  CONSTRAINT `ITEM_ISSRL_PTY` FOREIGN KEY (`PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `JOB_INTERVIEW`
--

DROP TABLE IF EXISTS `JOB_INTERVIEW`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `JOB_INTERVIEW` (
  `JOB_INTERVIEW_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `JOB_INTERVIEWEE_PARTY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `JOB_REQUISITION_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `JOB_INTERVIEWER_PARTY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `JOB_INTERVIEW_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `GRADE_SECURED_ENUM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `JOB_INTERVIEW_RESULT` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `JOB_INTERVIEW_DATE` date DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`JOB_INTERVIEW_ID`),
  KEY `JOB_INTW_IEPR` (`JOB_INTERVIEWEE_PARTY_ID`),
  KEY `JOB_INTW_IRPR` (`JOB_INTERVIEWER_PARTY_ID`),
  KEY `JOB_INTW_INTYP` (`JOB_INTERVIEW_TYPE_ID`),
  KEY `JOB_INTW_JBREQ` (`JOB_REQUISITION_ID`),
  KEY `JOB_INTW_ENUM` (`GRADE_SECURED_ENUM_ID`),
  KEY `JB_INTRVW_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `JB_INTRVW_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `JOB_INTW_ENUM` FOREIGN KEY (`GRADE_SECURED_ENUM_ID`) REFERENCES `ENUMERATION` (`ENUM_ID`),
  CONSTRAINT `JOB_INTW_IEPR` FOREIGN KEY (`JOB_INTERVIEWEE_PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `JOB_INTW_INTYP` FOREIGN KEY (`JOB_INTERVIEW_TYPE_ID`) REFERENCES `JOB_INTERVIEW_TYPE` (`JOB_INTERVIEW_TYPE_ID`),
  CONSTRAINT `JOB_INTW_IRPR` FOREIGN KEY (`JOB_INTERVIEWER_PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `JOB_INTW_JBREQ` FOREIGN KEY (`JOB_REQUISITION_ID`) REFERENCES `JOB_REQUISITION` (`JOB_REQUISITION_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `JOB_INTERVIEW_TYPE`
--

DROP TABLE IF EXISTS `JOB_INTERVIEW_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `JOB_INTERVIEW_TYPE` (
  `JOB_INTERVIEW_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`JOB_INTERVIEW_TYPE_ID`),
  KEY `JB_INTRW_TP_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `JB_INTRW_TP_TXCRTS` (`CREATED_TX_STAMP`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `JOB_REQUISITION`
--

DROP TABLE IF EXISTS `JOB_REQUISITION`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `JOB_REQUISITION` (
  `JOB_REQUISITION_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `DURATION_MONTHS` decimal(20,0) DEFAULT NULL,
  `AGE` decimal(20,0) DEFAULT NULL,
  `GENDER` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `EXPERIENCE_MONTHS` decimal(20,0) DEFAULT NULL,
  `EXPERIENCE_YEARS` decimal(20,0) DEFAULT NULL,
  `QUALIFICATION` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `JOB_LOCATION` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SKILL_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `NO_OF_RESOURCES` decimal(20,0) DEFAULT NULL,
  `JOB_POSTING_TYPE_ENUM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `JOB_REQUISITION_DATE` date DEFAULT NULL,
  `EXAM_TYPE_ENUM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `REQUIRED_ON_DATE` date DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`JOB_REQUISITION_ID`),
  KEY `JOB_REQ_SKTYP` (`SKILL_TYPE_ID`),
  KEY `JOB_REQ_ENUMEXM` (`EXAM_TYPE_ENUM_ID`),
  KEY `JOB_REQ_ENUMJBP` (`JOB_POSTING_TYPE_ENUM_ID`),
  KEY `JB_RQSTN_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `JB_RQSTN_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `JOB_REQ_ENUMEXM` FOREIGN KEY (`EXAM_TYPE_ENUM_ID`) REFERENCES `ENUMERATION` (`ENUM_ID`),
  CONSTRAINT `JOB_REQ_ENUMJBP` FOREIGN KEY (`JOB_POSTING_TYPE_ENUM_ID`) REFERENCES `ENUMERATION` (`ENUM_ID`),
  CONSTRAINT `JOB_REQ_SKTYP` FOREIGN KEY (`SKILL_TYPE_ID`) REFERENCES `SKILL_TYPE` (`SKILL_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `JOB_SANDBOX`
--

DROP TABLE IF EXISTS `JOB_SANDBOX`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `JOB_SANDBOX` (
  `JOB_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `JOB_NAME` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `RUN_TIME` datetime DEFAULT NULL,
  `POOL_ID` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `STATUS_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PARENT_JOB_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PREVIOUS_JOB_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SERVICE_NAME` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `LOADER_NAME` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `MAX_RETRY` decimal(20,0) DEFAULT NULL,
  `CURRENT_RETRY_COUNT` decimal(20,0) DEFAULT NULL,
  `AUTH_USER_LOGIN_ID` varchar(250) COLLATE latin1_general_cs DEFAULT NULL,
  `RUN_AS_USER` varchar(250) COLLATE latin1_general_cs DEFAULT NULL,
  `RUNTIME_DATA_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `RECURRENCE_INFO_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `TEMP_EXPR_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `CURRENT_RECURRENCE_COUNT` decimal(20,0) DEFAULT NULL,
  `MAX_RECURRENCE_COUNT` decimal(20,0) DEFAULT NULL,
  `RUN_BY_INSTANCE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `START_DATE_TIME` datetime DEFAULT NULL,
  `FINISH_DATE_TIME` datetime DEFAULT NULL,
  `CANCEL_DATE_TIME` datetime DEFAULT NULL,
  `JOB_RESULT` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`JOB_ID`),
  KEY `JOB_SNDBX_RECINFO` (`RECURRENCE_INFO_ID`),
  KEY `JOB_SNDBX_TEMPEXPR` (`TEMP_EXPR_ID`),
  KEY `JOB_SNDBX_RNTMDTA` (`RUNTIME_DATA_ID`),
  KEY `JOB_SNDBX_AUSRLGN` (`AUTH_USER_LOGIN_ID`),
  KEY `JOB_SNDBX_USRLGN` (`RUN_AS_USER`),
  KEY `JOB_SNDBX_STTS` (`STATUS_ID`),
  KEY `JOB_SANDBOX_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `JOB_SANDBOX_TXCRTS` (`CREATED_TX_STAMP`),
  KEY `JOB_SNDBX_RUNSTAT` (`RUN_BY_INSTANCE_ID`,`STATUS_ID`),
  CONSTRAINT `JOB_SNDBX_AUSRLGN` FOREIGN KEY (`AUTH_USER_LOGIN_ID`) REFERENCES `USER_LOGIN` (`USER_LOGIN_ID`),
  CONSTRAINT `JOB_SNDBX_RECINFO` FOREIGN KEY (`RECURRENCE_INFO_ID`) REFERENCES `RECURRENCE_INFO` (`RECURRENCE_INFO_ID`),
  CONSTRAINT `JOB_SNDBX_RNTMDTA` FOREIGN KEY (`RUNTIME_DATA_ID`) REFERENCES `RUNTIME_DATA` (`RUNTIME_DATA_ID`),
  CONSTRAINT `JOB_SNDBX_STTS` FOREIGN KEY (`STATUS_ID`) REFERENCES `STATUS_ITEM` (`STATUS_ID`),
  CONSTRAINT `JOB_SNDBX_TEMPEXPR` FOREIGN KEY (`TEMP_EXPR_ID`) REFERENCES `TEMPORAL_EXPRESSION` (`TEMP_EXPR_ID`),
  CONSTRAINT `JOB_SNDBX_USRLGN` FOREIGN KEY (`RUN_AS_USER`) REFERENCES `USER_LOGIN` (`USER_LOGIN_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `KEYWORD_THESAURUS`
--

DROP TABLE IF EXISTS `KEYWORD_THESAURUS`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `KEYWORD_THESAURUS` (
  `ENTERED_KEYWORD` varchar(255) COLLATE latin1_general_cs NOT NULL,
  `ALTERNATE_KEYWORD` varchar(255) COLLATE latin1_general_cs NOT NULL,
  `RELATIONSHIP_ENUM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`ENTERED_KEYWORD`,`ALTERNATE_KEYWORD`),
  KEY `KW_THRS_RLENM` (`RELATIONSHIP_ENUM_ID`),
  KEY `KWRD_THSRS_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `KWRD_THSRS_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `KW_THRS_RLENM` FOREIGN KEY (`RELATIONSHIP_ENUM_ID`) REFERENCES `ENUMERATION` (`ENUM_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `LOT`
--

DROP TABLE IF EXISTS `LOT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `LOT` (
  `LOT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CREATION_DATE` datetime DEFAULT NULL,
  `QUANTITY` decimal(18,6) DEFAULT NULL,
  `EXPIRATION_DATE` datetime DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`LOT_ID`),
  KEY `LOT_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `LOT_TXCRTS` (`CREATED_TX_STAMP`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `MARKETING_CAMPAIGN`
--

DROP TABLE IF EXISTS `MARKETING_CAMPAIGN`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `MARKETING_CAMPAIGN` (
  `MARKETING_CAMPAIGN_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARENT_CAMPAIGN_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `STATUS_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `CAMPAIGN_NAME` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `CAMPAIGN_SUMMARY` longtext COLLATE latin1_general_cs,
  `BUDGETED_COST` decimal(18,2) DEFAULT NULL,
  `ACTUAL_COST` decimal(18,2) DEFAULT NULL,
  `ESTIMATED_COST` decimal(18,2) DEFAULT NULL,
  `CURRENCY_UOM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `FROM_DATE` datetime DEFAULT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `IS_ACTIVE` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `CONVERTED_LEADS` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `EXPECTED_RESPONSE_PERCENT` double DEFAULT NULL,
  `EXPECTED_REVENUE` decimal(18,2) DEFAULT NULL,
  `NUM_SENT` decimal(20,0) DEFAULT NULL,
  `START_DATE` datetime DEFAULT NULL,
  `CREATED_BY_USER_LOGIN` varchar(250) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_MODIFIED_BY_USER_LOGIN` varchar(250) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`MARKETING_CAMPAIGN_ID`),
  KEY `MKTGCPN_PRNT` (`PARENT_CAMPAIGN_ID`),
  KEY `MKTGCPN_STS` (`STATUS_ID`),
  KEY `MKTGCPN_CUOM` (`CURRENCY_UOM_ID`),
  KEY `MRKTNG_CMPN_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `MRKTNG_CMPN_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `MKTGCPN_CUOM` FOREIGN KEY (`CURRENCY_UOM_ID`) REFERENCES `UOM` (`UOM_ID`),
  CONSTRAINT `MKTGCPN_PRNT` FOREIGN KEY (`PARENT_CAMPAIGN_ID`) REFERENCES `MARKETING_CAMPAIGN` (`MARKETING_CAMPAIGN_ID`),
  CONSTRAINT `MKTGCPN_STS` FOREIGN KEY (`STATUS_ID`) REFERENCES `STATUS_ITEM` (`STATUS_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `MARKETING_CAMPAIGN_NOTE`
--

DROP TABLE IF EXISTS `MARKETING_CAMPAIGN_NOTE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `MARKETING_CAMPAIGN_NOTE` (
  `MARKETING_CAMPAIGN_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `NOTE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`MARKETING_CAMPAIGN_ID`,`NOTE_ID`),
  KEY `MKTGCPN_NOTE_CMPN` (`MARKETING_CAMPAIGN_ID`),
  KEY `MKTGCPN_NOTE_NOTE` (`NOTE_ID`),
  KEY `MRKTG_CMN_NT_TXSTP` (`LAST_UPDATED_TX_STAMP`),
  KEY `MRKTG_CMN_NT_TXCRS` (`CREATED_TX_STAMP`),
  CONSTRAINT `MKTGCPN_NOTE_CMPN` FOREIGN KEY (`MARKETING_CAMPAIGN_ID`) REFERENCES `MARKETING_CAMPAIGN` (`MARKETING_CAMPAIGN_ID`),
  CONSTRAINT `MKTGCPN_NOTE_NOTE` FOREIGN KEY (`NOTE_ID`) REFERENCES `NOTE_DATA` (`NOTE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `MARKETING_CAMPAIGN_PRICE`
--

DROP TABLE IF EXISTS `MARKETING_CAMPAIGN_PRICE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `MARKETING_CAMPAIGN_PRICE` (
  `MARKETING_CAMPAIGN_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_PRICE_RULE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`MARKETING_CAMPAIGN_ID`,`PRODUCT_PRICE_RULE_ID`),
  KEY `MKTGCPN_PRICE_MC` (`MARKETING_CAMPAIGN_ID`),
  KEY `MKTGCPN_PRICE_PP` (`PRODUCT_PRICE_RULE_ID`),
  KEY `MRKG_CMN_PRC_TXSTP` (`LAST_UPDATED_TX_STAMP`),
  KEY `MRKG_CMN_PRC_TXCRS` (`CREATED_TX_STAMP`),
  CONSTRAINT `MKTGCPN_PRICE_MC` FOREIGN KEY (`MARKETING_CAMPAIGN_ID`) REFERENCES `MARKETING_CAMPAIGN` (`MARKETING_CAMPAIGN_ID`),
  CONSTRAINT `MKTGCPN_PRICE_PP` FOREIGN KEY (`PRODUCT_PRICE_RULE_ID`) REFERENCES `PRODUCT_PRICE_RULE` (`PRODUCT_PRICE_RULE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `MARKETING_CAMPAIGN_PROMO`
--

DROP TABLE IF EXISTS `MARKETING_CAMPAIGN_PROMO`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `MARKETING_CAMPAIGN_PROMO` (
  `MARKETING_CAMPAIGN_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_PROMO_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`MARKETING_CAMPAIGN_ID`,`PRODUCT_PROMO_ID`),
  KEY `MKTGCPN_PROMO_MC` (`MARKETING_CAMPAIGN_ID`),
  KEY `MKTGCPN_PROMO_PP` (`PRODUCT_PROMO_ID`),
  KEY `MRKG_CMN_PRM_TXSTP` (`LAST_UPDATED_TX_STAMP`),
  KEY `MRKG_CMN_PRM_TXCRS` (`CREATED_TX_STAMP`),
  CONSTRAINT `MKTGCPN_PROMO_MC` FOREIGN KEY (`MARKETING_CAMPAIGN_ID`) REFERENCES `MARKETING_CAMPAIGN` (`MARKETING_CAMPAIGN_ID`),
  CONSTRAINT `MKTGCPN_PROMO_PP` FOREIGN KEY (`PRODUCT_PROMO_ID`) REFERENCES `PRODUCT_PROMO` (`PRODUCT_PROMO_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `MARKETING_CAMPAIGN_ROLE`
--

DROP TABLE IF EXISTS `MARKETING_CAMPAIGN_ROLE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `MARKETING_CAMPAIGN_ROLE` (
  `MARKETING_CAMPAIGN_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ROLE_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`MARKETING_CAMPAIGN_ID`,`PARTY_ID`,`ROLE_TYPE_ID`),
  KEY `MKTGCPN_ROLE_MC` (`MARKETING_CAMPAIGN_ID`),
  KEY `MKTGCPN_ROLE_PR` (`PARTY_ID`,`ROLE_TYPE_ID`),
  KEY `MRKTG_CMN_RL_TXSTP` (`LAST_UPDATED_TX_STAMP`),
  KEY `MRKTG_CMN_RL_TXCRS` (`CREATED_TX_STAMP`),
  CONSTRAINT `MKTGCPN_ROLE_MC` FOREIGN KEY (`MARKETING_CAMPAIGN_ID`) REFERENCES `MARKETING_CAMPAIGN` (`MARKETING_CAMPAIGN_ID`),
  CONSTRAINT `MKTGCPN_ROLE_PR` FOREIGN KEY (`PARTY_ID`, `ROLE_TYPE_ID`) REFERENCES `PARTY_ROLE` (`PARTY_ID`, `ROLE_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `MARKET_INTEREST`
--

DROP TABLE IF EXISTS `MARKET_INTEREST`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `MARKET_INTEREST` (
  `PRODUCT_CATEGORY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARTY_CLASSIFICATION_GROUP_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FROM_DATE` datetime NOT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`PRODUCT_CATEGORY_ID`,`PARTY_CLASSIFICATION_GROUP_ID`,`FROM_DATE`),
  KEY `MARKET_INT_PCAT` (`PRODUCT_CATEGORY_ID`),
  KEY `MARKET_INT_PCGRP` (`PARTY_CLASSIFICATION_GROUP_ID`),
  KEY `MRKT_INTRST_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `MRKT_INTRST_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `MARKET_INT_PCAT` FOREIGN KEY (`PRODUCT_CATEGORY_ID`) REFERENCES `PRODUCT_CATEGORY` (`PRODUCT_CATEGORY_ID`),
  CONSTRAINT `MARKET_INT_PCGRP` FOREIGN KEY (`PARTY_CLASSIFICATION_GROUP_ID`) REFERENCES `PARTY_CLASSIFICATION_GROUP` (`PARTY_CLASSIFICATION_GROUP_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `META_DATA_PREDICATE`
--

DROP TABLE IF EXISTS `META_DATA_PREDICATE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `META_DATA_PREDICATE` (
  `META_DATA_PREDICATE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`META_DATA_PREDICATE_ID`),
  KEY `MT_DT_PRDCT_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `MT_DT_PRDCT_TXCRTS` (`CREATED_TX_STAMP`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `MIME_TYPE`
--

DROP TABLE IF EXISTS `MIME_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `MIME_TYPE` (
  `MIME_TYPE_ID` varchar(250) COLLATE latin1_general_cs NOT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`MIME_TYPE_ID`),
  KEY `MIME_TYPE_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `MIME_TYPE_TXCRTS` (`CREATED_TX_STAMP`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `MIME_TYPE_HTML_TEMPLATE`
--

DROP TABLE IF EXISTS `MIME_TYPE_HTML_TEMPLATE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `MIME_TYPE_HTML_TEMPLATE` (
  `MIME_TYPE_ID` varchar(250) COLLATE latin1_general_cs NOT NULL,
  `TEMPLATE_LOCATION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`MIME_TYPE_ID`),
  KEY `MIMETYPE_TPL_MT` (`MIME_TYPE_ID`),
  KEY `MM_TP_HTL_TMT_TXSP` (`LAST_UPDATED_TX_STAMP`),
  KEY `MM_TP_HTL_TMT_TXCS` (`CREATED_TX_STAMP`),
  CONSTRAINT `MIMETYPE_TPL_MT` FOREIGN KEY (`MIME_TYPE_ID`) REFERENCES `MIME_TYPE` (`MIME_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `MRP_EVENT`
--

DROP TABLE IF EXISTS `MRP_EVENT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `MRP_EVENT` (
  `MRP_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `EVENT_DATE` datetime NOT NULL,
  `MRP_EVENT_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FACILITY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `QUANTITY` double DEFAULT NULL,
  `EVENT_NAME` longtext COLLATE latin1_general_cs,
  `IS_LATE` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`MRP_ID`,`PRODUCT_ID`,`EVENT_DATE`,`MRP_EVENT_TYPE_ID`),
  KEY `MRPEV_PROD` (`PRODUCT_ID`),
  KEY `MRPEV_TYP` (`MRP_EVENT_TYPE_ID`),
  KEY `MRPEV_FAC` (`FACILITY_ID`),
  KEY `MRP_EVENT_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `MRP_EVENT_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `MRPEV_FAC` FOREIGN KEY (`FACILITY_ID`) REFERENCES `FACILITY` (`FACILITY_ID`),
  CONSTRAINT `MRPEV_PROD` FOREIGN KEY (`PRODUCT_ID`) REFERENCES `PRODUCT` (`PRODUCT_ID`),
  CONSTRAINT `MRPEV_TYP` FOREIGN KEY (`MRP_EVENT_TYPE_ID`) REFERENCES `MRP_EVENT_TYPE` (`MRP_EVENT_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `MRP_EVENT_TYPE`
--

DROP TABLE IF EXISTS `MRP_EVENT_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `MRP_EVENT_TYPE` (
  `MRP_EVENT_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`MRP_EVENT_TYPE_ID`),
  KEY `MRP_EVNT_TP_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `MRP_EVNT_TP_TXCRTS` (`CREATED_TX_STAMP`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `NEED_TYPE`
--

DROP TABLE IF EXISTS `NEED_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `NEED_TYPE` (
  `NEED_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`NEED_TYPE_ID`),
  KEY `NEED_TYPE_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `NEED_TYPE_TXCRTS` (`CREATED_TX_STAMP`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `NOTE_DATA`
--

DROP TABLE IF EXISTS `NOTE_DATA`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `NOTE_DATA` (
  `NOTE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `NOTE_NAME` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `NOTE_INFO` longtext COLLATE latin1_general_cs,
  `NOTE_DATE_TIME` datetime DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  `NOTE_PARTY` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `MORE_INFO_URL` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `MORE_INFO_ITEM_ID` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `MORE_INFO_ITEM_NAME` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  PRIMARY KEY (`NOTE_ID`),
  KEY `NOTE_DATA_PTY` (`NOTE_PARTY`),
  KEY `NOTE_DATA_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `NOTE_DATA_TXCRTS` (`CREATED_TX_STAMP`),
  KEY `systemInfo` (`NOTE_NAME`),
  CONSTRAINT `NOTE_DATA_PTY` FOREIGN KEY (`NOTE_PARTY`) REFERENCES `PARTY` (`PARTY_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ORDER_ADJUSTMENT`
--

DROP TABLE IF EXISTS `ORDER_ADJUSTMENT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ORDER_ADJUSTMENT` (
  `ORDER_ADJUSTMENT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ORDER_ADJUSTMENT_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ORDER_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ORDER_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SHIP_GROUP_SEQ_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `COMMENTS` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `AMOUNT` decimal(18,3) DEFAULT NULL,
  `RECURRING_AMOUNT` decimal(18,3) DEFAULT NULL,
  `AMOUNT_ALREADY_INCLUDED` decimal(18,3) DEFAULT NULL,
  `PRODUCT_PROMO_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PRODUCT_PROMO_RULE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PRODUCT_PROMO_ACTION_SEQ_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PRODUCT_FEATURE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `CORRESPONDING_PRODUCT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `TAX_AUTHORITY_RATE_SEQ_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SOURCE_REFERENCE_ID` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `SOURCE_PERCENTAGE` decimal(18,6) DEFAULT NULL,
  `CUSTOMER_REFERENCE_ID` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `PRIMARY_GEO_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SECONDARY_GEO_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `EXEMPT_AMOUNT` decimal(18,2) DEFAULT NULL,
  `TAX_AUTH_GEO_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `TAX_AUTH_PARTY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `OVERRIDE_GL_ACCOUNT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `INCLUDE_IN_TAX` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `INCLUDE_IN_SHIPPING` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `CREATED_DATE` datetime DEFAULT NULL,
  `CREATED_BY_USER_LOGIN` varchar(250) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_MODIFIED_DATE` datetime DEFAULT NULL,
  `LAST_MODIFIED_BY_USER_LOGIN` varchar(250) COLLATE latin1_general_cs DEFAULT NULL,
  `ORIGINAL_ADJUSTMENT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `AMOUNT_PER_QUANTITY` decimal(18,2) DEFAULT NULL,
  `PERCENTAGE` double DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`ORDER_ADJUSTMENT_ID`),
  KEY `ORDER_ADJ_TYPE` (`ORDER_ADJUSTMENT_TYPE_ID`),
  KEY `ORDER_ADJ_OHEAD` (`ORDER_ID`),
  KEY `ORDER_ADJ_USERL` (`CREATED_BY_USER_LOGIN`),
  KEY `ORDER_ADJ_PROMO` (`PRODUCT_PROMO_ID`),
  KEY `ORDER_ADJ_PRGEO` (`PRIMARY_GEO_ID`),
  KEY `ORDER_ADJ_SCGEO` (`SECONDARY_GEO_ID`),
  KEY `ORDER_ADJ_TXA` (`TAX_AUTH_GEO_ID`,`TAX_AUTH_PARTY_ID`),
  KEY `ORDER_ADJ_OGLA` (`OVERRIDE_GL_ACCOUNT_ID`),
  KEY `ORDER_ADJ_TARP` (`TAX_AUTHORITY_RATE_SEQ_ID`),
  KEY `ORR_ADJSTMT_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `ORR_ADJSTMT_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `ORDER_ADJ_OGLA` FOREIGN KEY (`OVERRIDE_GL_ACCOUNT_ID`) REFERENCES `GL_ACCOUNT` (`GL_ACCOUNT_ID`),
  CONSTRAINT `ORDER_ADJ_OHEAD` FOREIGN KEY (`ORDER_ID`) REFERENCES `ORDER_HEADER` (`ORDER_ID`),
  CONSTRAINT `ORDER_ADJ_PRGEO` FOREIGN KEY (`PRIMARY_GEO_ID`) REFERENCES `GEO` (`GEO_ID`),
  CONSTRAINT `ORDER_ADJ_PROMO` FOREIGN KEY (`PRODUCT_PROMO_ID`) REFERENCES `PRODUCT_PROMO` (`PRODUCT_PROMO_ID`),
  CONSTRAINT `ORDER_ADJ_SCGEO` FOREIGN KEY (`SECONDARY_GEO_ID`) REFERENCES `GEO` (`GEO_ID`),
  CONSTRAINT `ORDER_ADJ_TARP` FOREIGN KEY (`TAX_AUTHORITY_RATE_SEQ_ID`) REFERENCES `TAX_AUTHORITY_RATE_PRODUCT` (`TAX_AUTHORITY_RATE_SEQ_ID`),
  CONSTRAINT `ORDER_ADJ_TXA` FOREIGN KEY (`TAX_AUTH_GEO_ID`, `TAX_AUTH_PARTY_ID`) REFERENCES `TAX_AUTHORITY` (`TAX_AUTH_GEO_ID`, `TAX_AUTH_PARTY_ID`),
  CONSTRAINT `ORDER_ADJ_TYPE` FOREIGN KEY (`ORDER_ADJUSTMENT_TYPE_ID`) REFERENCES `ORDER_ADJUSTMENT_TYPE` (`ORDER_ADJUSTMENT_TYPE_ID`),
  CONSTRAINT `ORDER_ADJ_USERL` FOREIGN KEY (`CREATED_BY_USER_LOGIN`) REFERENCES `USER_LOGIN` (`USER_LOGIN_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ORDER_ADJUSTMENT_ATTRIBUTE`
--

DROP TABLE IF EXISTS `ORDER_ADJUSTMENT_ATTRIBUTE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ORDER_ADJUSTMENT_ATTRIBUTE` (
  `ORDER_ADJUSTMENT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ATTR_NAME` varchar(60) COLLATE latin1_general_cs NOT NULL,
  `ATTR_VALUE` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`ORDER_ADJUSTMENT_ID`,`ATTR_NAME`),
  KEY `ORDER_ADJ_ATTR` (`ORDER_ADJUSTMENT_ID`),
  KEY `ORR_ADJST_ATT_TXSP` (`LAST_UPDATED_TX_STAMP`),
  KEY `ORR_ADJST_ATT_TXCS` (`CREATED_TX_STAMP`),
  CONSTRAINT `ORDER_ADJ_ATTR` FOREIGN KEY (`ORDER_ADJUSTMENT_ID`) REFERENCES `ORDER_ADJUSTMENT` (`ORDER_ADJUSTMENT_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ORDER_ADJUSTMENT_BILLING`
--

DROP TABLE IF EXISTS `ORDER_ADJUSTMENT_BILLING`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ORDER_ADJUSTMENT_BILLING` (
  `ORDER_ADJUSTMENT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `INVOICE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `INVOICE_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `AMOUNT` decimal(18,2) DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`ORDER_ADJUSTMENT_ID`,`INVOICE_ID`,`INVOICE_ITEM_SEQ_ID`),
  KEY `ORDER_ADJBLNG_OA` (`ORDER_ADJUSTMENT_ID`),
  KEY `ORDER_ADJBLNG_IITM` (`INVOICE_ID`,`INVOICE_ITEM_SEQ_ID`),
  KEY `ORR_ADJST_BLG_TXSP` (`LAST_UPDATED_TX_STAMP`),
  KEY `ORR_ADJST_BLG_TXCS` (`CREATED_TX_STAMP`),
  CONSTRAINT `ORDER_ADJBLNG_IITM` FOREIGN KEY (`INVOICE_ID`, `INVOICE_ITEM_SEQ_ID`) REFERENCES `INVOICE_ITEM` (`INVOICE_ID`, `INVOICE_ITEM_SEQ_ID`),
  CONSTRAINT `ORDER_ADJBLNG_OA` FOREIGN KEY (`ORDER_ADJUSTMENT_ID`) REFERENCES `ORDER_ADJUSTMENT` (`ORDER_ADJUSTMENT_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ORDER_ADJUSTMENT_TYPE`
--

DROP TABLE IF EXISTS `ORDER_ADJUSTMENT_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ORDER_ADJUSTMENT_TYPE` (
  `ORDER_ADJUSTMENT_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARENT_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `HAS_TABLE` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`ORDER_ADJUSTMENT_TYPE_ID`),
  KEY `ORDER_ADJ_TYPPAR` (`PARENT_TYPE_ID`),
  KEY `ORR_ADJSTT_TP_TXSP` (`LAST_UPDATED_TX_STAMP`),
  KEY `ORR_ADJSTT_TP_TXCS` (`CREATED_TX_STAMP`),
  CONSTRAINT `ORDER_ADJ_TYPPAR` FOREIGN KEY (`PARENT_TYPE_ID`) REFERENCES `ORDER_ADJUSTMENT_TYPE` (`ORDER_ADJUSTMENT_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ORDER_ADJUSTMENT_TYPE_ATTR`
--

DROP TABLE IF EXISTS `ORDER_ADJUSTMENT_TYPE_ATTR`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ORDER_ADJUSTMENT_TYPE_ATTR` (
  `ORDER_ADJUSTMENT_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ATTR_NAME` varchar(60) COLLATE latin1_general_cs NOT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`ORDER_ADJUSTMENT_TYPE_ID`,`ATTR_NAME`),
  KEY `ORDER_ADJ_TYPATTR` (`ORDER_ADJUSTMENT_TYPE_ID`),
  KEY `ORR_ADJT_TP_ATR_TP` (`LAST_UPDATED_TX_STAMP`),
  KEY `ORR_ADJT_TP_ATR_TS` (`CREATED_TX_STAMP`),
  CONSTRAINT `ORDER_ADJ_TYPATTR` FOREIGN KEY (`ORDER_ADJUSTMENT_TYPE_ID`) REFERENCES `ORDER_ADJUSTMENT_TYPE` (`ORDER_ADJUSTMENT_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ORDER_ATTRIBUTE`
--

DROP TABLE IF EXISTS `ORDER_ATTRIBUTE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ORDER_ATTRIBUTE` (
  `ORDER_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ATTR_NAME` varchar(60) COLLATE latin1_general_cs NOT NULL,
  `ATTR_VALUE` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`ORDER_ID`,`ATTR_NAME`),
  KEY `ORDER_ATTR_HDR` (`ORDER_ID`),
  KEY `ORDR_ATTRBT_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `ORDR_ATTRBT_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `ORDER_ATTR_HDR` FOREIGN KEY (`ORDER_ID`) REFERENCES `ORDER_HEADER` (`ORDER_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ORDER_BLACKLIST`
--

DROP TABLE IF EXISTS `ORDER_BLACKLIST`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ORDER_BLACKLIST` (
  `BLACKLIST_STRING` varchar(255) COLLATE latin1_general_cs NOT NULL,
  `ORDER_BLACKLIST_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`BLACKLIST_STRING`,`ORDER_BLACKLIST_TYPE_ID`),
  KEY `ORDER_BKL_TYPE` (`ORDER_BLACKLIST_TYPE_ID`),
  KEY `ORDR_BLCKLT_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `ORDR_BLCKLT_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `ORDER_BKL_TYPE` FOREIGN KEY (`ORDER_BLACKLIST_TYPE_ID`) REFERENCES `ORDER_BLACKLIST_TYPE` (`ORDER_BLACKLIST_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ORDER_BLACKLIST_TYPE`
--

DROP TABLE IF EXISTS `ORDER_BLACKLIST_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ORDER_BLACKLIST_TYPE` (
  `ORDER_BLACKLIST_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`ORDER_BLACKLIST_TYPE_ID`),
  KEY `ORR_BLCKT_TP_TXSTP` (`LAST_UPDATED_TX_STAMP`),
  KEY `ORR_BLCKT_TP_TXCRS` (`CREATED_TX_STAMP`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ORDER_CONTACT_MECH`
--

DROP TABLE IF EXISTS `ORDER_CONTACT_MECH`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ORDER_CONTACT_MECH` (
  `ORDER_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CONTACT_MECH_PURPOSE_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CONTACT_MECH_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`ORDER_ID`,`CONTACT_MECH_PURPOSE_TYPE_ID`,`CONTACT_MECH_ID`),
  KEY `ORDER_CMECH_HDR` (`ORDER_ID`),
  KEY `ORDER_CMECH_CM` (`CONTACT_MECH_ID`),
  KEY `ORDER_CMECH_CMPT` (`CONTACT_MECH_PURPOSE_TYPE_ID`),
  KEY `ORR_CNTT_MCH_TXSTP` (`LAST_UPDATED_TX_STAMP`),
  KEY `ORR_CNTT_MCH_TXCRS` (`CREATED_TX_STAMP`),
  CONSTRAINT `ORDER_CMECH_CM` FOREIGN KEY (`CONTACT_MECH_ID`) REFERENCES `CONTACT_MECH` (`CONTACT_MECH_ID`),
  CONSTRAINT `ORDER_CMECH_CMPT` FOREIGN KEY (`CONTACT_MECH_PURPOSE_TYPE_ID`) REFERENCES `CONTACT_MECH_PURPOSE_TYPE` (`CONTACT_MECH_PURPOSE_TYPE_ID`),
  CONSTRAINT `ORDER_CMECH_HDR` FOREIGN KEY (`ORDER_ID`) REFERENCES `ORDER_HEADER` (`ORDER_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ORDER_CONTENT`
--

DROP TABLE IF EXISTS `ORDER_CONTENT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ORDER_CONTENT` (
  `ORDER_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ORDER_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CONTENT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ORDER_CONTENT_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FROM_DATE` datetime NOT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`CONTENT_ID`,`ORDER_ID`,`ORDER_ITEM_SEQ_ID`,`ORDER_CONTENT_TYPE_ID`,`FROM_DATE`),
  KEY `ORD_CNT_PROD` (`ORDER_ID`),
  KEY `ORD_CNT_CNT` (`CONTENT_ID`),
  KEY `ORD_CNT_TYPE` (`ORDER_CONTENT_TYPE_ID`),
  KEY `ORDR_CNTNT_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `ORDR_CNTNT_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `ORD_CNT_CNT` FOREIGN KEY (`CONTENT_ID`) REFERENCES `CONTENT` (`CONTENT_ID`),
  CONSTRAINT `ORD_CNT_PROD` FOREIGN KEY (`ORDER_ID`) REFERENCES `ORDER_HEADER` (`ORDER_ID`),
  CONSTRAINT `ORD_CNT_TYPE` FOREIGN KEY (`ORDER_CONTENT_TYPE_ID`) REFERENCES `ORDER_CONTENT_TYPE` (`ORDER_CONTENT_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ORDER_CONTENT_TYPE`
--

DROP TABLE IF EXISTS `ORDER_CONTENT_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ORDER_CONTENT_TYPE` (
  `ORDER_CONTENT_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARENT_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `HAS_TABLE` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`ORDER_CONTENT_TYPE_ID`),
  KEY `ORDCT_TYP_PARENT` (`PARENT_TYPE_ID`),
  KEY `ORR_CNTT_TP_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `ORR_CNTT_TP_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `ORDCT_TYP_PARENT` FOREIGN KEY (`PARENT_TYPE_ID`) REFERENCES `ORDER_CONTENT_TYPE` (`ORDER_CONTENT_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ORDER_DELIVERY_SCHEDULE`
--

DROP TABLE IF EXISTS `ORDER_DELIVERY_SCHEDULE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ORDER_DELIVERY_SCHEDULE` (
  `ORDER_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ORDER_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ESTIMATED_READY_DATE` datetime DEFAULT NULL,
  `CARTONS` decimal(20,0) DEFAULT NULL,
  `SKIDS_PALLETS` decimal(20,0) DEFAULT NULL,
  `UNITS_PIECES` decimal(18,6) DEFAULT NULL,
  `TOTAL_CUBIC_SIZE` decimal(18,6) DEFAULT NULL,
  `TOTAL_CUBIC_UOM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `TOTAL_WEIGHT` decimal(18,6) DEFAULT NULL,
  `TOTAL_WEIGHT_UOM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `STATUS_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`ORDER_ID`,`ORDER_ITEM_SEQ_ID`),
  KEY `ORDER_DELSCH_OHDR` (`ORDER_ID`),
  KEY `ORDER_DELSCH_TCUOM` (`TOTAL_CUBIC_UOM_ID`),
  KEY `ORDER_DELSCH_TWUOM` (`TOTAL_WEIGHT_UOM_ID`),
  KEY `ORDER_DELSCH_STTS` (`STATUS_ID`),
  KEY `ORR_DLR_SCHL_TXSTP` (`LAST_UPDATED_TX_STAMP`),
  KEY `ORR_DLR_SCHL_TXCRS` (`CREATED_TX_STAMP`),
  CONSTRAINT `ORDER_DELSCH_OHDR` FOREIGN KEY (`ORDER_ID`) REFERENCES `ORDER_HEADER` (`ORDER_ID`),
  CONSTRAINT `ORDER_DELSCH_STTS` FOREIGN KEY (`STATUS_ID`) REFERENCES `STATUS_ITEM` (`STATUS_ID`),
  CONSTRAINT `ORDER_DELSCH_TCUOM` FOREIGN KEY (`TOTAL_CUBIC_UOM_ID`) REFERENCES `UOM` (`UOM_ID`),
  CONSTRAINT `ORDER_DELSCH_TWUOM` FOREIGN KEY (`TOTAL_WEIGHT_UOM_ID`) REFERENCES `UOM` (`UOM_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ORDER_HEADER`
--

DROP TABLE IF EXISTS `ORDER_HEADER`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ORDER_HEADER` (
  `ORDER_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ORDER_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ORDER_NAME` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `EXTERNAL_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SALES_CHANNEL_ENUM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ORDER_DATE` datetime DEFAULT NULL,
  `PRIORITY` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `ENTRY_DATE` datetime DEFAULT NULL,
  `PICK_SHEET_PRINTED_DATE` datetime DEFAULT NULL,
  `VISIT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `STATUS_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `CREATED_BY` varchar(250) COLLATE latin1_general_cs DEFAULT NULL,
  `FIRST_ATTEMPT_ORDER_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `CURRENCY_UOM` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SYNC_STATUS_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `BILLING_ACCOUNT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ORIGIN_FACILITY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `WEB_SITE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PRODUCT_STORE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `TERMINAL_ID` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `TRANSACTION_ID` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `AUTO_ORDER_SHOPPING_LIST_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `NEEDS_INVENTORY_ISSUANCE` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `IS_RUSH_ORDER` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `INTERNAL_CODE` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `REMAINING_SUB_TOTAL` decimal(18,2) DEFAULT NULL,
  `GRAND_TOTAL` decimal(18,2) DEFAULT NULL,
  `IS_VIEWED` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `INVOICE_PER_SHIPMENT` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`ORDER_ID`),
  KEY `ORDER_HDR_TYPE` (`ORDER_TYPE_ID`),
  KEY `ORDER_HDR_SCENUM` (`SALES_CHANNEL_ENUM_ID`),
  KEY `ORDER_HDR_OFAC` (`ORIGIN_FACILITY_ID`),
  KEY `ORDER_HDR_BACCT` (`BILLING_ACCOUNT_ID`),
  KEY `ORDER_HDR_PDSTR` (`PRODUCT_STORE_ID`),
  KEY `ORDER_HDR_AOSHLST` (`AUTO_ORDER_SHOPPING_LIST_ID`),
  KEY `ORDER_HDR_CBUL` (`CREATED_BY`),
  KEY `ORDER_HDR_STTS` (`STATUS_ID`),
  KEY `ORDER_HDR_SYST` (`SYNC_STATUS_ID`),
  KEY `ORDER_HDR_CUOM` (`CURRENCY_UOM`),
  KEY `ORDR_HDR_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `ORDR_HDR_TXCRTS` (`CREATED_TX_STAMP`),
  KEY `ORDEREXT_ID_IDX` (`EXTERNAL_ID`),
  CONSTRAINT `ORDER_HDR_AOSHLST` FOREIGN KEY (`AUTO_ORDER_SHOPPING_LIST_ID`) REFERENCES `SHOPPING_LIST` (`SHOPPING_LIST_ID`),
  CONSTRAINT `ORDER_HDR_BACCT` FOREIGN KEY (`BILLING_ACCOUNT_ID`) REFERENCES `BILLING_ACCOUNT` (`BILLING_ACCOUNT_ID`),
  CONSTRAINT `ORDER_HDR_CBUL` FOREIGN KEY (`CREATED_BY`) REFERENCES `USER_LOGIN` (`USER_LOGIN_ID`),
  CONSTRAINT `ORDER_HDR_CUOM` FOREIGN KEY (`CURRENCY_UOM`) REFERENCES `UOM` (`UOM_ID`),
  CONSTRAINT `ORDER_HDR_OFAC` FOREIGN KEY (`ORIGIN_FACILITY_ID`) REFERENCES `FACILITY` (`FACILITY_ID`),
  CONSTRAINT `ORDER_HDR_PDSTR` FOREIGN KEY (`PRODUCT_STORE_ID`) REFERENCES `PRODUCT_STORE` (`PRODUCT_STORE_ID`),
  CONSTRAINT `ORDER_HDR_SCENUM` FOREIGN KEY (`SALES_CHANNEL_ENUM_ID`) REFERENCES `ENUMERATION` (`ENUM_ID`),
  CONSTRAINT `ORDER_HDR_STTS` FOREIGN KEY (`STATUS_ID`) REFERENCES `STATUS_ITEM` (`STATUS_ID`),
  CONSTRAINT `ORDER_HDR_SYST` FOREIGN KEY (`SYNC_STATUS_ID`) REFERENCES `STATUS_ITEM` (`STATUS_ID`),
  CONSTRAINT `ORDER_HDR_TYPE` FOREIGN KEY (`ORDER_TYPE_ID`) REFERENCES `ORDER_TYPE` (`ORDER_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ORDER_HEADER_NOTE`
--

DROP TABLE IF EXISTS `ORDER_HEADER_NOTE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ORDER_HEADER_NOTE` (
  `ORDER_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `NOTE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `INTERNAL_NOTE` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`ORDER_ID`,`NOTE_ID`),
  KEY `ORDER_HDRNT_HDR` (`ORDER_ID`),
  KEY `ORDER_HDRNT_NOTE` (`NOTE_ID`),
  KEY `ORDR_HDR_NT_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `ORDR_HDR_NT_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `ORDER_HDRNT_HDR` FOREIGN KEY (`ORDER_ID`) REFERENCES `ORDER_HEADER` (`ORDER_ID`),
  CONSTRAINT `ORDER_HDRNT_NOTE` FOREIGN KEY (`NOTE_ID`) REFERENCES `NOTE_DATA` (`NOTE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ORDER_HEADER_WORK_EFFORT`
--

DROP TABLE IF EXISTS `ORDER_HEADER_WORK_EFFORT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ORDER_HEADER_WORK_EFFORT` (
  `ORDER_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `WORK_EFFORT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`ORDER_ID`,`WORK_EFFORT_ID`),
  KEY `ORDERHDWE_OH` (`ORDER_ID`),
  KEY `ORDERHDWE_WEFF` (`WORK_EFFORT_ID`),
  KEY `ORR_HDR_WRK_EFT_TP` (`LAST_UPDATED_TX_STAMP`),
  KEY `ORR_HDR_WRK_EFT_TS` (`CREATED_TX_STAMP`),
  CONSTRAINT `ORDERHDWE_OH` FOREIGN KEY (`ORDER_ID`) REFERENCES `ORDER_HEADER` (`ORDER_ID`),
  CONSTRAINT `ORDERHDWE_WEFF` FOREIGN KEY (`WORK_EFFORT_ID`) REFERENCES `WORK_EFFORT` (`WORK_EFFORT_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ORDER_ITEM`
--

DROP TABLE IF EXISTS `ORDER_ITEM`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ORDER_ITEM` (
  `ORDER_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ORDER_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `EXTERNAL_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ORDER_ITEM_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ORDER_ITEM_GROUP_SEQ_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `IS_ITEM_GROUP_PRIMARY` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `FROM_INVENTORY_ITEM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `BUDGET_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `BUDGET_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PRODUCT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SUPPLIER_PRODUCT_ID` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `PRODUCT_FEATURE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PROD_CATALOG_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PRODUCT_CATEGORY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `IS_PROMO` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `QUOTE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `QUOTE_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SHOPPING_LIST_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SHOPPING_LIST_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SUBSCRIPTION_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `DEPLOYMENT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `QUANTITY` decimal(18,6) DEFAULT NULL,
  `CANCEL_QUANTITY` decimal(18,6) DEFAULT NULL,
  `SELECTED_AMOUNT` decimal(18,6) DEFAULT NULL,
  `UNIT_PRICE` decimal(18,3) DEFAULT NULL,
  `UNIT_LIST_PRICE` decimal(18,3) DEFAULT NULL,
  `UNIT_AVERAGE_COST` decimal(18,2) DEFAULT NULL,
  `UNIT_RECURRING_PRICE` decimal(18,2) DEFAULT NULL,
  `IS_MODIFIED_PRICE` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `RECURRING_FREQ_UOM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ITEM_DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `COMMENTS` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `CORRESPONDING_PO_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `STATUS_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SYNC_STATUS_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ESTIMATED_SHIP_DATE` datetime DEFAULT NULL,
  `ESTIMATED_DELIVERY_DATE` datetime DEFAULT NULL,
  `AUTO_CANCEL_DATE` datetime DEFAULT NULL,
  `DONT_CANCEL_SET_DATE` datetime DEFAULT NULL,
  `DONT_CANCEL_SET_USER_LOGIN` varchar(250) COLLATE latin1_general_cs DEFAULT NULL,
  `SHIP_BEFORE_DATE` datetime DEFAULT NULL,
  `SHIP_AFTER_DATE` datetime DEFAULT NULL,
  `CANCEL_BACK_ORDER_DATE` datetime DEFAULT NULL,
  `OVERRIDE_GL_ACCOUNT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SALES_OPPORTUNITY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `CHANGE_BY_USER_LOGIN_ID` varchar(250) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`ORDER_ID`,`ORDER_ITEM_SEQ_ID`),
  KEY `ORDER_ITEM_HDR` (`ORDER_ID`),
  KEY `ORDER_ITEM_ORTYP` (`ORDER_ITEM_TYPE_ID`),
  KEY `ORDER_ITEM_ITGRP` (`ORDER_ID`,`ORDER_ITEM_GROUP_SEQ_ID`),
  KEY `ORDER_ITEM_PRODUCT` (`PRODUCT_ID`),
  KEY `ORDER_ITEM_FMINV` (`FROM_INVENTORY_ITEM_ID`),
  KEY `ORDER_ITEM_RFUOM` (`RECURRING_FREQ_UOM_ID`),
  KEY `ORDER_ITEM_STTS` (`STATUS_ID`),
  KEY `ORDER_ITEM_SYST` (`SYNC_STATUS_ID`),
  KEY `ORDER_ITEM_DCUL` (`DONT_CANCEL_SET_USER_LOGIN`),
  KEY `ORDER_ITEM_QUIT` (`QUOTE_ID`,`QUOTE_ITEM_SEQ_ID`),
  KEY `ORDER_ITEM_OGLA` (`OVERRIDE_GL_ACCOUNT_ID`),
  KEY `ORDER_ITEM_SLSOPP` (`SALES_OPPORTUNITY_ID`),
  KEY `ORDER_ITEM_USRLGN` (`CHANGE_BY_USER_LOGIN_ID`),
  KEY `ORDER_ITEM_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `ORDER_ITEM_TXCRTS` (`CREATED_TX_STAMP`),
  KEY `ORDITMEXT_ID_IDX` (`EXTERNAL_ID`),
  CONSTRAINT `ORDER_ITEM_DCUL` FOREIGN KEY (`DONT_CANCEL_SET_USER_LOGIN`) REFERENCES `USER_LOGIN` (`USER_LOGIN_ID`),
  CONSTRAINT `ORDER_ITEM_FMINV` FOREIGN KEY (`FROM_INVENTORY_ITEM_ID`) REFERENCES `INVENTORY_ITEM` (`INVENTORY_ITEM_ID`),
  CONSTRAINT `ORDER_ITEM_HDR` FOREIGN KEY (`ORDER_ID`) REFERENCES `ORDER_HEADER` (`ORDER_ID`),
  CONSTRAINT `ORDER_ITEM_ITGRP` FOREIGN KEY (`ORDER_ID`, `ORDER_ITEM_GROUP_SEQ_ID`) REFERENCES `ORDER_ITEM_GROUP` (`ORDER_ID`, `ORDER_ITEM_GROUP_SEQ_ID`),
  CONSTRAINT `ORDER_ITEM_OGLA` FOREIGN KEY (`OVERRIDE_GL_ACCOUNT_ID`) REFERENCES `GL_ACCOUNT` (`GL_ACCOUNT_ID`),
  CONSTRAINT `ORDER_ITEM_ORTYP` FOREIGN KEY (`ORDER_ITEM_TYPE_ID`) REFERENCES `ORDER_ITEM_TYPE` (`ORDER_ITEM_TYPE_ID`),
  CONSTRAINT `ORDER_ITEM_PRODUCT` FOREIGN KEY (`PRODUCT_ID`) REFERENCES `PRODUCT` (`PRODUCT_ID`),
  CONSTRAINT `ORDER_ITEM_QUIT` FOREIGN KEY (`QUOTE_ID`, `QUOTE_ITEM_SEQ_ID`) REFERENCES `QUOTE_ITEM` (`QUOTE_ID`, `QUOTE_ITEM_SEQ_ID`),
  CONSTRAINT `ORDER_ITEM_RFUOM` FOREIGN KEY (`RECURRING_FREQ_UOM_ID`) REFERENCES `UOM` (`UOM_ID`),
  CONSTRAINT `ORDER_ITEM_SLSOPP` FOREIGN KEY (`SALES_OPPORTUNITY_ID`) REFERENCES `SALES_OPPORTUNITY` (`SALES_OPPORTUNITY_ID`),
  CONSTRAINT `ORDER_ITEM_STTS` FOREIGN KEY (`STATUS_ID`) REFERENCES `STATUS_ITEM` (`STATUS_ID`),
  CONSTRAINT `ORDER_ITEM_SYST` FOREIGN KEY (`SYNC_STATUS_ID`) REFERENCES `STATUS_ITEM` (`STATUS_ID`),
  CONSTRAINT `ORDER_ITEM_USRLGN` FOREIGN KEY (`CHANGE_BY_USER_LOGIN_ID`) REFERENCES `USER_LOGIN` (`USER_LOGIN_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ORDER_ITEM_ASSOC`
--

DROP TABLE IF EXISTS `ORDER_ITEM_ASSOC`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ORDER_ITEM_ASSOC` (
  `ORDER_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ORDER_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `SHIP_GROUP_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `TO_ORDER_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `TO_ORDER_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `TO_SHIP_GROUP_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ORDER_ITEM_ASSOC_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `QUANTITY` decimal(18,6) DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`ORDER_ID`,`ORDER_ITEM_SEQ_ID`,`SHIP_GROUP_SEQ_ID`,`TO_ORDER_ID`,`TO_ORDER_ITEM_SEQ_ID`,`TO_SHIP_GROUP_SEQ_ID`,`ORDER_ITEM_ASSOC_TYPE_ID`),
  KEY `ORDER_ITASS_TYPE` (`ORDER_ITEM_ASSOC_TYPE_ID`),
  KEY `ORDER_ITASS_FRHD` (`ORDER_ID`),
  KEY `ORDER_ITASS_TOHD` (`TO_ORDER_ID`),
  KEY `ORR_ITM_ASC_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `ORR_ITM_ASC_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `ORDER_ITASS_FRHD` FOREIGN KEY (`ORDER_ID`) REFERENCES `ORDER_HEADER` (`ORDER_ID`),
  CONSTRAINT `ORDER_ITASS_TOHD` FOREIGN KEY (`TO_ORDER_ID`) REFERENCES `ORDER_HEADER` (`ORDER_ID`),
  CONSTRAINT `ORDER_ITASS_TYPE` FOREIGN KEY (`ORDER_ITEM_ASSOC_TYPE_ID`) REFERENCES `ORDER_ITEM_ASSOC_TYPE` (`ORDER_ITEM_ASSOC_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ORDER_ITEM_ASSOCIATION`
--

DROP TABLE IF EXISTS `ORDER_ITEM_ASSOCIATION`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ORDER_ITEM_ASSOCIATION` (
  `SALES_ORDER_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `SO_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PURCHASE_ORDER_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PO_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`SALES_ORDER_ID`,`SO_ITEM_SEQ_ID`,`PURCHASE_ORDER_ID`,`PO_ITEM_SEQ_ID`),
  KEY `ORDER_ITASSC_SOHD` (`SALES_ORDER_ID`),
  KEY `ORDER_ITASSC_POHD` (`PURCHASE_ORDER_ID`),
  KEY `ORR_ITM_ASSN_TXSTP` (`LAST_UPDATED_TX_STAMP`),
  KEY `ORR_ITM_ASSN_TXCRS` (`CREATED_TX_STAMP`),
  CONSTRAINT `ORDER_ITASSC_POHD` FOREIGN KEY (`PURCHASE_ORDER_ID`) REFERENCES `ORDER_HEADER` (`ORDER_ID`),
  CONSTRAINT `ORDER_ITASSC_SOHD` FOREIGN KEY (`SALES_ORDER_ID`) REFERENCES `ORDER_HEADER` (`ORDER_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ORDER_ITEM_ASSOC_TYPE`
--

DROP TABLE IF EXISTS `ORDER_ITEM_ASSOC_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ORDER_ITEM_ASSOC_TYPE` (
  `ORDER_ITEM_ASSOC_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARENT_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `HAS_TABLE` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`ORDER_ITEM_ASSOC_TYPE_ID`),
  KEY `ORDER_ITAS_TYPPAR` (`PARENT_TYPE_ID`),
  KEY `ORR_ITM_ASC_TP_TXP` (`LAST_UPDATED_TX_STAMP`),
  KEY `ORR_ITM_ASC_TP_TXS` (`CREATED_TX_STAMP`),
  CONSTRAINT `ORDER_ITAS_TYPPAR` FOREIGN KEY (`PARENT_TYPE_ID`) REFERENCES `ORDER_ITEM_ASSOC_TYPE` (`ORDER_ITEM_ASSOC_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ORDER_ITEM_ATTRIBUTE`
--

DROP TABLE IF EXISTS `ORDER_ITEM_ATTRIBUTE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ORDER_ITEM_ATTRIBUTE` (
  `ORDER_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ORDER_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ATTR_NAME` varchar(60) COLLATE latin1_general_cs NOT NULL,
  `ATTR_VALUE` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`ORDER_ID`,`ORDER_ITEM_SEQ_ID`,`ATTR_NAME`),
  KEY `ORDER_ITEM_ATTR` (`ORDER_ID`,`ORDER_ITEM_SEQ_ID`),
  KEY `ORR_ITM_ATTT_TXSTP` (`LAST_UPDATED_TX_STAMP`),
  KEY `ORR_ITM_ATTT_TXCRS` (`CREATED_TX_STAMP`),
  CONSTRAINT `ORDER_ITEM_ATTR` FOREIGN KEY (`ORDER_ID`, `ORDER_ITEM_SEQ_ID`) REFERENCES `ORDER_ITEM` (`ORDER_ID`, `ORDER_ITEM_SEQ_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ORDER_ITEM_BILLING`
--

DROP TABLE IF EXISTS `ORDER_ITEM_BILLING`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ORDER_ITEM_BILLING` (
  `ORDER_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ORDER_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `INVOICE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `INVOICE_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ITEM_ISSUANCE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SHIPMENT_RECEIPT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `QUANTITY` decimal(18,6) DEFAULT NULL,
  `AMOUNT` decimal(18,2) DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`ORDER_ID`,`ORDER_ITEM_SEQ_ID`,`INVOICE_ID`,`INVOICE_ITEM_SEQ_ID`),
  KEY `ORDER_ITBLNG_OHDR` (`ORDER_ID`),
  KEY `ORDER_ITBLNG_OITM` (`ORDER_ID`,`ORDER_ITEM_SEQ_ID`),
  KEY `ORDER_ITBLNG_IITM` (`INVOICE_ID`,`INVOICE_ITEM_SEQ_ID`),
  KEY `ORDER_ITBL_SHIPRCP` (`SHIPMENT_RECEIPT_ID`),
  KEY `ORDER_ITBLNG_IISS` (`ITEM_ISSUANCE_ID`),
  KEY `ORR_ITM_BLLG_TXSTP` (`LAST_UPDATED_TX_STAMP`),
  KEY `ORR_ITM_BLLG_TXCRS` (`CREATED_TX_STAMP`),
  CONSTRAINT `ORDER_ITBLNG_IISS` FOREIGN KEY (`ITEM_ISSUANCE_ID`) REFERENCES `ITEM_ISSUANCE` (`ITEM_ISSUANCE_ID`),
  CONSTRAINT `ORDER_ITBLNG_IITM` FOREIGN KEY (`INVOICE_ID`, `INVOICE_ITEM_SEQ_ID`) REFERENCES `INVOICE_ITEM` (`INVOICE_ID`, `INVOICE_ITEM_SEQ_ID`),
  CONSTRAINT `ORDER_ITBLNG_OHDR` FOREIGN KEY (`ORDER_ID`) REFERENCES `ORDER_HEADER` (`ORDER_ID`),
  CONSTRAINT `ORDER_ITBLNG_OITM` FOREIGN KEY (`ORDER_ID`, `ORDER_ITEM_SEQ_ID`) REFERENCES `ORDER_ITEM` (`ORDER_ID`, `ORDER_ITEM_SEQ_ID`),
  CONSTRAINT `ORDER_ITBL_SHIPRCP` FOREIGN KEY (`SHIPMENT_RECEIPT_ID`) REFERENCES `SHIPMENT_RECEIPT` (`RECEIPT_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ORDER_ITEM_CHANGE`
--

DROP TABLE IF EXISTS `ORDER_ITEM_CHANGE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ORDER_ITEM_CHANGE` (
  `ORDER_ITEM_CHANGE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ORDER_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ORDER_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `CHANGE_TYPE_ENUM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `CHANGE_DATETIME` datetime DEFAULT NULL,
  `CHANGE_USER_LOGIN` varchar(250) COLLATE latin1_general_cs DEFAULT NULL,
  `QUANTITY` decimal(18,6) DEFAULT NULL,
  `CANCEL_QUANTITY` decimal(18,6) DEFAULT NULL,
  `UNIT_PRICE` decimal(18,2) DEFAULT NULL,
  `ITEM_DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `REASON_ENUM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `CHANGE_COMMENTS` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`ORDER_ITEM_CHANGE_ID`),
  KEY `ORDER_ITCH_OITM` (`ORDER_ID`,`ORDER_ITEM_SEQ_ID`),
  KEY `ORDER_ITCH_TYPE` (`CHANGE_TYPE_ENUM_ID`),
  KEY `ORDER_ITCH_REAS` (`REASON_ENUM_ID`),
  KEY `ORDER_ITCH_USER` (`CHANGE_USER_LOGIN`),
  KEY `ORR_ITM_CHG_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `ORR_ITM_CHG_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `ORDER_ITCH_OITM` FOREIGN KEY (`ORDER_ID`, `ORDER_ITEM_SEQ_ID`) REFERENCES `ORDER_ITEM` (`ORDER_ID`, `ORDER_ITEM_SEQ_ID`),
  CONSTRAINT `ORDER_ITCH_REAS` FOREIGN KEY (`REASON_ENUM_ID`) REFERENCES `ENUMERATION` (`ENUM_ID`),
  CONSTRAINT `ORDER_ITCH_TYPE` FOREIGN KEY (`CHANGE_TYPE_ENUM_ID`) REFERENCES `ENUMERATION` (`ENUM_ID`),
  CONSTRAINT `ORDER_ITCH_USER` FOREIGN KEY (`CHANGE_USER_LOGIN`) REFERENCES `USER_LOGIN` (`USER_LOGIN_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ORDER_ITEM_CONTACT_MECH`
--

DROP TABLE IF EXISTS `ORDER_ITEM_CONTACT_MECH`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ORDER_ITEM_CONTACT_MECH` (
  `ORDER_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ORDER_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CONTACT_MECH_PURPOSE_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CONTACT_MECH_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`ORDER_ID`,`ORDER_ITEM_SEQ_ID`,`CONTACT_MECH_PURPOSE_TYPE_ID`),
  KEY `ORDER_ITCM_OITM` (`ORDER_ID`,`ORDER_ITEM_SEQ_ID`),
  KEY `ORDER_ITCM_CMECH` (`CONTACT_MECH_ID`),
  KEY `ORDER_ITCM_CMPT` (`CONTACT_MECH_PURPOSE_TYPE_ID`),
  KEY `ORR_ITM_CNT_MCH_TP` (`LAST_UPDATED_TX_STAMP`),
  KEY `ORR_ITM_CNT_MCH_TS` (`CREATED_TX_STAMP`),
  CONSTRAINT `ORDER_ITCM_CMECH` FOREIGN KEY (`CONTACT_MECH_ID`) REFERENCES `CONTACT_MECH` (`CONTACT_MECH_ID`),
  CONSTRAINT `ORDER_ITCM_CMPT` FOREIGN KEY (`CONTACT_MECH_PURPOSE_TYPE_ID`) REFERENCES `CONTACT_MECH_PURPOSE_TYPE` (`CONTACT_MECH_PURPOSE_TYPE_ID`),
  CONSTRAINT `ORDER_ITCM_OITM` FOREIGN KEY (`ORDER_ID`, `ORDER_ITEM_SEQ_ID`) REFERENCES `ORDER_ITEM` (`ORDER_ID`, `ORDER_ITEM_SEQ_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ORDER_ITEM_GROUP`
--

DROP TABLE IF EXISTS `ORDER_ITEM_GROUP`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ORDER_ITEM_GROUP` (
  `ORDER_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ORDER_ITEM_GROUP_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARENT_GROUP_SEQ_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `GROUP_NAME` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`ORDER_ID`,`ORDER_ITEM_GROUP_SEQ_ID`),
  KEY `ORDERITMGRP_HDR` (`ORDER_ID`),
  KEY `ORDERITMGRP_PGRP` (`ORDER_ID`,`PARENT_GROUP_SEQ_ID`),
  KEY `ORR_ITM_GRP_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `ORR_ITM_GRP_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `ORDERITMGRP_HDR` FOREIGN KEY (`ORDER_ID`) REFERENCES `ORDER_HEADER` (`ORDER_ID`),
  CONSTRAINT `ORDERITMGRP_PGRP` FOREIGN KEY (`ORDER_ID`, `PARENT_GROUP_SEQ_ID`) REFERENCES `ORDER_ITEM_GROUP` (`ORDER_ID`, `ORDER_ITEM_GROUP_SEQ_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ORDER_ITEM_GROUP_ORDER`
--

DROP TABLE IF EXISTS `ORDER_ITEM_GROUP_ORDER`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ORDER_ITEM_GROUP_ORDER` (
  `ORDER_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ORDER_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `GROUP_ORDER_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`ORDER_ID`,`ORDER_ITEM_SEQ_ID`,`GROUP_ORDER_ID`),
  KEY `OIGO_ORDER_ITEM` (`ORDER_ID`,`ORDER_ITEM_SEQ_ID`),
  KEY `OIGO_GROUP_ORDER` (`GROUP_ORDER_ID`),
  KEY `ORR_ITM_GRP_ORR_TP` (`LAST_UPDATED_TX_STAMP`),
  KEY `ORR_ITM_GRP_ORR_TS` (`CREATED_TX_STAMP`),
  CONSTRAINT `OIGO_GROUP_ORDER` FOREIGN KEY (`GROUP_ORDER_ID`) REFERENCES `PRODUCT_GROUP_ORDER` (`GROUP_ORDER_ID`),
  CONSTRAINT `OIGO_ORDER_ITEM` FOREIGN KEY (`ORDER_ID`, `ORDER_ITEM_SEQ_ID`) REFERENCES `ORDER_ITEM` (`ORDER_ID`, `ORDER_ITEM_SEQ_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ORDER_ITEM_INVENTORY_RES`
--

DROP TABLE IF EXISTS `ORDER_ITEM_INVENTORY_RES`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ORDER_ITEM_INVENTORY_RES` (
  `ORDER_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ORDER_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `INVENTORY_ITEM_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `RESERVE_ORDER_ENUM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `QUANTITY` double DEFAULT NULL,
  `QUANTITY_NOT_AVAILABLE` double DEFAULT NULL,
  `RESERVED_DATETIME` datetime DEFAULT NULL,
  `CREATED_DATETIME` datetime DEFAULT NULL,
  `PROMISED_DATETIME` datetime DEFAULT NULL,
  `CURRENT_PROMISED_DATE` datetime DEFAULT NULL,
  `PICK_START_DATE` datetime DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`ORDER_ID`,`ORDER_ITEM_SEQ_ID`,`INVENTORY_ITEM_ID`),
  KEY `OLDODR_ITIR_OITM` (`ORDER_ID`,`ORDER_ITEM_SEQ_ID`),
  KEY `OLDODR_ITIR_INVITM` (`INVENTORY_ITEM_ID`),
  KEY `ORR_ITM_INR_RS_TXP` (`LAST_UPDATED_TX_STAMP`),
  KEY `ORR_ITM_INR_RS_TXS` (`CREATED_TX_STAMP`),
  CONSTRAINT `OLDODR_ITIR_INVITM` FOREIGN KEY (`INVENTORY_ITEM_ID`) REFERENCES `INVENTORY_ITEM` (`INVENTORY_ITEM_ID`),
  CONSTRAINT `OLDODR_ITIR_OITM` FOREIGN KEY (`ORDER_ID`, `ORDER_ITEM_SEQ_ID`) REFERENCES `ORDER_ITEM` (`ORDER_ID`, `ORDER_ITEM_SEQ_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ORDER_ITEM_PRICE_INFO`
--

DROP TABLE IF EXISTS `ORDER_ITEM_PRICE_INFO`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ORDER_ITEM_PRICE_INFO` (
  `ORDER_ITEM_PRICE_INFO_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ORDER_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ORDER_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PRODUCT_PRICE_RULE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PRODUCT_PRICE_ACTION_SEQ_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `MODIFY_AMOUNT` decimal(18,3) DEFAULT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `RATE_CODE` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`ORDER_ITEM_PRICE_INFO_ID`),
  KEY `ORDER_OIPI_OITM` (`ORDER_ID`,`ORDER_ITEM_SEQ_ID`),
  KEY `ORDER_OIPI_PRAI` (`PRODUCT_PRICE_RULE_ID`,`PRODUCT_PRICE_ACTION_SEQ_ID`),
  KEY `ORR_ITM_PRC_INF_TP` (`LAST_UPDATED_TX_STAMP`),
  KEY `ORR_ITM_PRC_INF_TS` (`CREATED_TX_STAMP`),
  CONSTRAINT `ORDER_OIPI_OITM` FOREIGN KEY (`ORDER_ID`, `ORDER_ITEM_SEQ_ID`) REFERENCES `ORDER_ITEM` (`ORDER_ID`, `ORDER_ITEM_SEQ_ID`),
  CONSTRAINT `ORDER_OIPI_PRAI` FOREIGN KEY (`PRODUCT_PRICE_RULE_ID`, `PRODUCT_PRICE_ACTION_SEQ_ID`) REFERENCES `PRODUCT_PRICE_ACTION` (`PRODUCT_PRICE_RULE_ID`, `PRODUCT_PRICE_ACTION_SEQ_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ORDER_ITEM_ROLE`
--

DROP TABLE IF EXISTS `ORDER_ITEM_ROLE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ORDER_ITEM_ROLE` (
  `ORDER_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ORDER_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ROLE_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`ORDER_ID`,`ORDER_ITEM_SEQ_ID`,`PARTY_ID`,`ROLE_TYPE_ID`),
  KEY `ORDER_ITRL_OHDR` (`ORDER_ID`),
  KEY `ORDER_ITRL_OITM` (`ORDER_ID`,`ORDER_ITEM_SEQ_ID`),
  KEY `ORDER_ITRL_PARTY` (`PARTY_ID`),
  KEY `ORDER_ITRL_PTRLE` (`PARTY_ID`,`ROLE_TYPE_ID`),
  KEY `ORDR_ITM_RL_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `ORDR_ITM_RL_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `ORDER_ITRL_OHDR` FOREIGN KEY (`ORDER_ID`) REFERENCES `ORDER_HEADER` (`ORDER_ID`),
  CONSTRAINT `ORDER_ITRL_OITM` FOREIGN KEY (`ORDER_ID`, `ORDER_ITEM_SEQ_ID`) REFERENCES `ORDER_ITEM` (`ORDER_ID`, `ORDER_ITEM_SEQ_ID`),
  CONSTRAINT `ORDER_ITRL_PARTY` FOREIGN KEY (`PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `ORDER_ITRL_PTRLE` FOREIGN KEY (`PARTY_ID`, `ROLE_TYPE_ID`) REFERENCES `PARTY_ROLE` (`PARTY_ID`, `ROLE_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ORDER_ITEM_SHIP_GROUP`
--

DROP TABLE IF EXISTS `ORDER_ITEM_SHIP_GROUP`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ORDER_ITEM_SHIP_GROUP` (
  `ORDER_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `SHIP_GROUP_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `SHIPMENT_METHOD_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SUPPLIER_PARTY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `VENDOR_PARTY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `CARRIER_PARTY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `CARRIER_ROLE_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `FACILITY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `CONTACT_MECH_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `TELECOM_CONTACT_MECH_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `TRACKING_NUMBER` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `SHIPPING_INSTRUCTIONS` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `MAY_SPLIT` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `GIFT_MESSAGE` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `IS_GIFT` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `SHIP_AFTER_DATE` datetime DEFAULT NULL,
  `SHIP_BY_DATE` datetime DEFAULT NULL,
  `ESTIMATED_SHIP_DATE` datetime DEFAULT NULL,
  `ESTIMATED_DELIVERY_DATE` datetime DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`ORDER_ID`,`SHIP_GROUP_SEQ_ID`),
  KEY `ORDER_ITSG_ORDH` (`ORDER_ID`),
  KEY `ORDER_ITSG_SPRTY` (`SUPPLIER_PARTY_ID`),
  KEY `ORDER_ITSG_VPRTY` (`VENDOR_PARTY_ID`),
  KEY `ORDER_ITSG_CSHM` (`SHIPMENT_METHOD_TYPE_ID`,`CARRIER_PARTY_ID`,`CARRIER_ROLE_TYPE_ID`),
  KEY `ORDER_ITSG_CPRTY` (`CARRIER_PARTY_ID`),
  KEY `ORDER_ITSG_CPRLE` (`CARRIER_PARTY_ID`,`CARRIER_ROLE_TYPE_ID`),
  KEY `ORDER_ITSG_FAC` (`FACILITY_ID`),
  KEY `ORDER_ITSG_SHMTP` (`SHIPMENT_METHOD_TYPE_ID`),
  KEY `ORDER_ITSG_CNTM` (`CONTACT_MECH_ID`),
  KEY `ORDER_ITSG_PADR` (`CONTACT_MECH_ID`),
  KEY `ORDER_ITSG_TCNT` (`TELECOM_CONTACT_MECH_ID`),
  KEY `ORDER_ITSG_TCNB` (`TELECOM_CONTACT_MECH_ID`),
  KEY `ORR_ITM_SHP_GRP_TP` (`LAST_UPDATED_TX_STAMP`),
  KEY `ORR_ITM_SHP_GRP_TS` (`CREATED_TX_STAMP`),
  CONSTRAINT `ORDER_ITSG_CNTM` FOREIGN KEY (`CONTACT_MECH_ID`) REFERENCES `CONTACT_MECH` (`CONTACT_MECH_ID`),
  CONSTRAINT `ORDER_ITSG_CPRLE` FOREIGN KEY (`CARRIER_PARTY_ID`, `CARRIER_ROLE_TYPE_ID`) REFERENCES `PARTY_ROLE` (`PARTY_ID`, `ROLE_TYPE_ID`),
  CONSTRAINT `ORDER_ITSG_CPRTY` FOREIGN KEY (`CARRIER_PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `ORDER_ITSG_CSHM` FOREIGN KEY (`SHIPMENT_METHOD_TYPE_ID`, `CARRIER_PARTY_ID`, `CARRIER_ROLE_TYPE_ID`) REFERENCES `CARRIER_SHIPMENT_METHOD` (`SHIPMENT_METHOD_TYPE_ID`, `PARTY_ID`, `ROLE_TYPE_ID`),
  CONSTRAINT `ORDER_ITSG_FAC` FOREIGN KEY (`FACILITY_ID`) REFERENCES `FACILITY` (`FACILITY_ID`),
  CONSTRAINT `ORDER_ITSG_ORDH` FOREIGN KEY (`ORDER_ID`) REFERENCES `ORDER_HEADER` (`ORDER_ID`),
  CONSTRAINT `ORDER_ITSG_PADR` FOREIGN KEY (`CONTACT_MECH_ID`) REFERENCES `POSTAL_ADDRESS` (`CONTACT_MECH_ID`),
  CONSTRAINT `ORDER_ITSG_SHMTP` FOREIGN KEY (`SHIPMENT_METHOD_TYPE_ID`) REFERENCES `SHIPMENT_METHOD_TYPE` (`SHIPMENT_METHOD_TYPE_ID`),
  CONSTRAINT `ORDER_ITSG_SPRTY` FOREIGN KEY (`SUPPLIER_PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `ORDER_ITSG_TCNB` FOREIGN KEY (`TELECOM_CONTACT_MECH_ID`) REFERENCES `TELECOM_NUMBER` (`CONTACT_MECH_ID`),
  CONSTRAINT `ORDER_ITSG_TCNT` FOREIGN KEY (`TELECOM_CONTACT_MECH_ID`) REFERENCES `CONTACT_MECH` (`CONTACT_MECH_ID`),
  CONSTRAINT `ORDER_ITSG_VPRTY` FOREIGN KEY (`VENDOR_PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ORDER_ITEM_SHIP_GROUP_ASSOC`
--

DROP TABLE IF EXISTS `ORDER_ITEM_SHIP_GROUP_ASSOC`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ORDER_ITEM_SHIP_GROUP_ASSOC` (
  `ORDER_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ORDER_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `SHIP_GROUP_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `QUANTITY` decimal(18,6) DEFAULT NULL,
  `CANCEL_QUANTITY` decimal(18,6) DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`ORDER_ID`,`ORDER_ITEM_SEQ_ID`,`SHIP_GROUP_SEQ_ID`),
  KEY `ORDER_ISGA_ORDH` (`ORDER_ID`),
  KEY `ORDER_ISGA_ORDI` (`ORDER_ID`,`ORDER_ITEM_SEQ_ID`),
  KEY `ORDER_ISGA_OISG` (`ORDER_ID`,`SHIP_GROUP_SEQ_ID`),
  KEY `ORR_SHP_GRP_ASC_TP` (`LAST_UPDATED_TX_STAMP`),
  KEY `ORR_SHP_GRP_ASC_TS` (`CREATED_TX_STAMP`),
  CONSTRAINT `ORDER_ISGA_OISG` FOREIGN KEY (`ORDER_ID`, `SHIP_GROUP_SEQ_ID`) REFERENCES `ORDER_ITEM_SHIP_GROUP` (`ORDER_ID`, `SHIP_GROUP_SEQ_ID`),
  CONSTRAINT `ORDER_ISGA_ORDH` FOREIGN KEY (`ORDER_ID`) REFERENCES `ORDER_HEADER` (`ORDER_ID`),
  CONSTRAINT `ORDER_ISGA_ORDI` FOREIGN KEY (`ORDER_ID`, `ORDER_ITEM_SEQ_ID`) REFERENCES `ORDER_ITEM` (`ORDER_ID`, `ORDER_ITEM_SEQ_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ORDER_ITEM_SHIP_GRP_INV_RES`
--

DROP TABLE IF EXISTS `ORDER_ITEM_SHIP_GRP_INV_RES`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ORDER_ITEM_SHIP_GRP_INV_RES` (
  `ORDER_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `SHIP_GROUP_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ORDER_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `INVENTORY_ITEM_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `RESERVE_ORDER_ENUM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `QUANTITY` decimal(18,6) DEFAULT NULL,
  `QUANTITY_NOT_AVAILABLE` decimal(18,6) DEFAULT NULL,
  `RESERVED_DATETIME` datetime DEFAULT NULL,
  `CREATED_DATETIME` datetime DEFAULT NULL,
  `PROMISED_DATETIME` datetime DEFAULT NULL,
  `CURRENT_PROMISED_DATE` datetime DEFAULT NULL,
  `PRIORITY` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `SEQUENCE_ID` decimal(20,0) DEFAULT NULL,
  `PICK_START_DATE` datetime DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`ORDER_ID`,`SHIP_GROUP_SEQ_ID`,`ORDER_ITEM_SEQ_ID`,`INVENTORY_ITEM_ID`),
  KEY `ORDER_ITIR_OITM` (`ORDER_ID`,`ORDER_ITEM_SEQ_ID`),
  KEY `ORDER_ITIR_INVITM` (`INVENTORY_ITEM_ID`),
  KEY `ORR_GRP_INV_RS_TP` (`LAST_UPDATED_TX_STAMP`),
  KEY `ORR_GRP_INV_RS_TS` (`CREATED_TX_STAMP`),
  CONSTRAINT `ORDER_ITIR_INVITM` FOREIGN KEY (`INVENTORY_ITEM_ID`) REFERENCES `INVENTORY_ITEM` (`INVENTORY_ITEM_ID`),
  CONSTRAINT `ORDER_ITIR_OITM` FOREIGN KEY (`ORDER_ID`, `ORDER_ITEM_SEQ_ID`) REFERENCES `ORDER_ITEM` (`ORDER_ID`, `ORDER_ITEM_SEQ_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ORDER_ITEM_TYPE`
--

DROP TABLE IF EXISTS `ORDER_ITEM_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ORDER_ITEM_TYPE` (
  `ORDER_ITEM_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARENT_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `HAS_TABLE` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`ORDER_ITEM_TYPE_ID`),
  KEY `ORDER_ITEM_TYPPAR` (`PARENT_TYPE_ID`),
  KEY `ORDR_ITM_TP_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `ORDR_ITM_TP_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `ORDER_ITEM_TYPPAR` FOREIGN KEY (`PARENT_TYPE_ID`) REFERENCES `ORDER_ITEM_TYPE` (`ORDER_ITEM_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ORDER_ITEM_TYPE_ATTR`
--

DROP TABLE IF EXISTS `ORDER_ITEM_TYPE_ATTR`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ORDER_ITEM_TYPE_ATTR` (
  `ORDER_ITEM_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ATTR_NAME` varchar(60) COLLATE latin1_general_cs NOT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`ORDER_ITEM_TYPE_ID`,`ATTR_NAME`),
  KEY `ORDER_ITEM_TYPATR` (`ORDER_ITEM_TYPE_ID`),
  KEY `ORR_ITM_TP_ATR_TXP` (`LAST_UPDATED_TX_STAMP`),
  KEY `ORR_ITM_TP_ATR_TXS` (`CREATED_TX_STAMP`),
  CONSTRAINT `ORDER_ITEM_TYPATR` FOREIGN KEY (`ORDER_ITEM_TYPE_ID`) REFERENCES `ORDER_ITEM_TYPE` (`ORDER_ITEM_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ORDER_NOTIFICATION`
--

DROP TABLE IF EXISTS `ORDER_NOTIFICATION`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ORDER_NOTIFICATION` (
  `ORDER_NOTIFICATION_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ORDER_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `EMAIL_TYPE` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `COMMENTS` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `NOTIFICATION_DATE` datetime DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`ORDER_NOTIFICATION_ID`),
  KEY `ORD_NOTIFY_ORDHDR` (`ORDER_ID`),
  KEY `ORD_NOTIFY_ENUM` (`EMAIL_TYPE`),
  KEY `ORDR_NTFCTN_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `ORDR_NTFCTN_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `ORD_NOTIFY_ENUM` FOREIGN KEY (`EMAIL_TYPE`) REFERENCES `ENUMERATION` (`ENUM_ID`),
  CONSTRAINT `ORD_NOTIFY_ORDHDR` FOREIGN KEY (`ORDER_ID`) REFERENCES `ORDER_HEADER` (`ORDER_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ORDER_PAYMENT_PREFERENCE`
--

DROP TABLE IF EXISTS `ORDER_PAYMENT_PREFERENCE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ORDER_PAYMENT_PREFERENCE` (
  `ORDER_PAYMENT_PREFERENCE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ORDER_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ORDER_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SHIP_GROUP_SEQ_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PRODUCT_PRICE_PURPOSE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PAYMENT_METHOD_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PAYMENT_METHOD_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `FIN_ACCOUNT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SECURITY_CODE` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `TRACK2` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `PRESENT_FLAG` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `SWIPED_FLAG` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `OVERFLOW_FLAG` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `MAX_AMOUNT` decimal(18,2) DEFAULT NULL,
  `PROCESS_ATTEMPT` decimal(20,0) DEFAULT NULL,
  `BILLING_POSTAL_CODE` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `MANUAL_AUTH_CODE` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `MANUAL_REF_NUM` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `STATUS_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `NEEDS_NSF_RETRY` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `CREATED_DATE` datetime DEFAULT NULL,
  `CREATED_BY_USER_LOGIN` varchar(250) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_MODIFIED_DATE` datetime DEFAULT NULL,
  `LAST_MODIFIED_BY_USER_LOGIN` varchar(250) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`ORDER_PAYMENT_PREFERENCE_ID`),
  KEY `ORDER_PMPRF_OHDR` (`ORDER_ID`),
  KEY `ORDER_PMPRF_PPRP` (`PRODUCT_PRICE_PURPOSE_ID`),
  KEY `ORDER_PMPRF_PMTP` (`PAYMENT_METHOD_TYPE_ID`),
  KEY `ORDER_PMPRF_PMETH` (`PAYMENT_METHOD_ID`),
  KEY `ORDER_PMPRF_FINACT` (`FIN_ACCOUNT_ID`),
  KEY `ORDER_PMPRF_STTS` (`STATUS_ID`),
  KEY `ORDER_PMPRF_USRL` (`CREATED_BY_USER_LOGIN`),
  KEY `ORR_PMT_PRFC_TXSTP` (`LAST_UPDATED_TX_STAMP`),
  KEY `ORR_PMT_PRFC_TXCRS` (`CREATED_TX_STAMP`),
  KEY `NSF_RETRY_CHECK` (`NEEDS_NSF_RETRY`),
  CONSTRAINT `ORDER_PMPRF_FINACT` FOREIGN KEY (`FIN_ACCOUNT_ID`) REFERENCES `FIN_ACCOUNT` (`FIN_ACCOUNT_ID`),
  CONSTRAINT `ORDER_PMPRF_OHDR` FOREIGN KEY (`ORDER_ID`) REFERENCES `ORDER_HEADER` (`ORDER_ID`),
  CONSTRAINT `ORDER_PMPRF_PMETH` FOREIGN KEY (`PAYMENT_METHOD_ID`) REFERENCES `PAYMENT_METHOD` (`PAYMENT_METHOD_ID`),
  CONSTRAINT `ORDER_PMPRF_PMTP` FOREIGN KEY (`PAYMENT_METHOD_TYPE_ID`) REFERENCES `PAYMENT_METHOD_TYPE` (`PAYMENT_METHOD_TYPE_ID`),
  CONSTRAINT `ORDER_PMPRF_PPRP` FOREIGN KEY (`PRODUCT_PRICE_PURPOSE_ID`) REFERENCES `PRODUCT_PRICE_PURPOSE` (`PRODUCT_PRICE_PURPOSE_ID`),
  CONSTRAINT `ORDER_PMPRF_STTS` FOREIGN KEY (`STATUS_ID`) REFERENCES `STATUS_ITEM` (`STATUS_ID`),
  CONSTRAINT `ORDER_PMPRF_USRL` FOREIGN KEY (`CREATED_BY_USER_LOGIN`) REFERENCES `USER_LOGIN` (`USER_LOGIN_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ORDER_PRODUCT_PROMO_CODE`
--

DROP TABLE IF EXISTS `ORDER_PRODUCT_PROMO_CODE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ORDER_PRODUCT_PROMO_CODE` (
  `ORDER_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_PROMO_CODE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`ORDER_ID`,`PRODUCT_PROMO_CODE_ID`),
  KEY `ORDER_PPCD_ORD` (`ORDER_ID`),
  KEY `ORDER_PPCD_PPC` (`PRODUCT_PROMO_CODE_ID`),
  KEY `ORR_PRT_PRM_CD_TXP` (`LAST_UPDATED_TX_STAMP`),
  KEY `ORR_PRT_PRM_CD_TXS` (`CREATED_TX_STAMP`),
  CONSTRAINT `ORDER_PPCD_ORD` FOREIGN KEY (`ORDER_ID`) REFERENCES `ORDER_HEADER` (`ORDER_ID`),
  CONSTRAINT `ORDER_PPCD_PPC` FOREIGN KEY (`PRODUCT_PROMO_CODE_ID`) REFERENCES `PRODUCT_PROMO_CODE` (`PRODUCT_PROMO_CODE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ORDER_REQUIREMENT_COMMITMENT`
--

DROP TABLE IF EXISTS `ORDER_REQUIREMENT_COMMITMENT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ORDER_REQUIREMENT_COMMITMENT` (
  `ORDER_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ORDER_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `REQUIREMENT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `QUANTITY` decimal(18,6) DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`ORDER_ID`,`ORDER_ITEM_SEQ_ID`,`REQUIREMENT_ID`),
  KEY `ORDREQ_CMT_ORD` (`ORDER_ID`),
  KEY `ORDREQ_CMT_OITM` (`ORDER_ID`,`ORDER_ITEM_SEQ_ID`),
  KEY `ORDREQ_CMT_REQ` (`REQUIREMENT_ID`),
  KEY `ORR_RQRT_CMMT_TXSP` (`LAST_UPDATED_TX_STAMP`),
  KEY `ORR_RQRT_CMMT_TXCS` (`CREATED_TX_STAMP`),
  CONSTRAINT `ORDREQ_CMT_OITM` FOREIGN KEY (`ORDER_ID`, `ORDER_ITEM_SEQ_ID`) REFERENCES `ORDER_ITEM` (`ORDER_ID`, `ORDER_ITEM_SEQ_ID`),
  CONSTRAINT `ORDREQ_CMT_ORD` FOREIGN KEY (`ORDER_ID`) REFERENCES `ORDER_HEADER` (`ORDER_ID`),
  CONSTRAINT `ORDREQ_CMT_REQ` FOREIGN KEY (`REQUIREMENT_ID`) REFERENCES `REQUIREMENT` (`REQUIREMENT_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ORDER_ROLE`
--

DROP TABLE IF EXISTS `ORDER_ROLE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ORDER_ROLE` (
  `ORDER_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ROLE_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`ORDER_ID`,`PARTY_ID`,`ROLE_TYPE_ID`),
  KEY `ORDER_ROLE_OHDR` (`ORDER_ID`),
  KEY `ORDER_ROLE_PARTY` (`PARTY_ID`),
  KEY `ORDER_ROLE_PROLE` (`PARTY_ID`,`ROLE_TYPE_ID`),
  KEY `ORDER_ROLE_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `ORDER_ROLE_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `ORDER_ROLE_OHDR` FOREIGN KEY (`ORDER_ID`) REFERENCES `ORDER_HEADER` (`ORDER_ID`),
  CONSTRAINT `ORDER_ROLE_PARTY` FOREIGN KEY (`PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `ORDER_ROLE_PROLE` FOREIGN KEY (`PARTY_ID`, `ROLE_TYPE_ID`) REFERENCES `PARTY_ROLE` (`PARTY_ID`, `ROLE_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ORDER_SHIPMENT`
--

DROP TABLE IF EXISTS `ORDER_SHIPMENT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ORDER_SHIPMENT` (
  `ORDER_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ORDER_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `SHIP_GROUP_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `SHIPMENT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `SHIPMENT_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `QUANTITY` decimal(18,6) DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`ORDER_ID`,`ORDER_ITEM_SEQ_ID`,`SHIP_GROUP_SEQ_ID`,`SHIPMENT_ID`,`SHIPMENT_ITEM_SEQ_ID`),
  KEY `ORDER_SHPMT_OHDR` (`ORDER_ID`),
  KEY `ORDER_SHPMT_SHPMT` (`SHIPMENT_ID`),
  KEY `ORDR_SHPMNT_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `ORDR_SHPMNT_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `ORDER_SHPMT_OHDR` FOREIGN KEY (`ORDER_ID`) REFERENCES `ORDER_HEADER` (`ORDER_ID`),
  CONSTRAINT `ORDER_SHPMT_SHPMT` FOREIGN KEY (`SHIPMENT_ID`) REFERENCES `SHIPMENT` (`SHIPMENT_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ORDER_SHIPMENT_PREFERENCE`
--

DROP TABLE IF EXISTS `ORDER_SHIPMENT_PREFERENCE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ORDER_SHIPMENT_PREFERENCE` (
  `ORDER_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ORDER_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `SHIPMENT_METHOD_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `CARRIER_PARTY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `CARRIER_ROLE_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `TRACKING_NUMBER` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `SHIPPING_INSTRUCTIONS` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `MAY_SPLIT` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `GIFT_MESSAGE` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `IS_GIFT` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `SHIP_AFTER_DATE` datetime DEFAULT NULL,
  `SHIP_BEFORE_DATE` datetime DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`ORDER_ID`,`ORDER_ITEM_SEQ_ID`),
  KEY `ORDER_SHPREF_CSHM` (`SHIPMENT_METHOD_TYPE_ID`,`CARRIER_PARTY_ID`,`CARRIER_ROLE_TYPE_ID`),
  KEY `ORDER_SHPREF_OHDR` (`ORDER_ID`),
  KEY `ORDER_SHPREF_CPRTY` (`CARRIER_PARTY_ID`),
  KEY `ORDER_SHPREF_CPRLE` (`CARRIER_PARTY_ID`,`CARRIER_ROLE_TYPE_ID`),
  KEY `ORDER_SHPREF_SHMTP` (`SHIPMENT_METHOD_TYPE_ID`),
  KEY `ORR_SHPT_PRFC_TXSP` (`LAST_UPDATED_TX_STAMP`),
  KEY `ORR_SHPT_PRFC_TXCS` (`CREATED_TX_STAMP`),
  CONSTRAINT `ORDER_SHPREF_CPRLE` FOREIGN KEY (`CARRIER_PARTY_ID`, `CARRIER_ROLE_TYPE_ID`) REFERENCES `PARTY_ROLE` (`PARTY_ID`, `ROLE_TYPE_ID`),
  CONSTRAINT `ORDER_SHPREF_CPRTY` FOREIGN KEY (`CARRIER_PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `ORDER_SHPREF_CSHM` FOREIGN KEY (`SHIPMENT_METHOD_TYPE_ID`, `CARRIER_PARTY_ID`, `CARRIER_ROLE_TYPE_ID`) REFERENCES `CARRIER_SHIPMENT_METHOD` (`SHIPMENT_METHOD_TYPE_ID`, `PARTY_ID`, `ROLE_TYPE_ID`),
  CONSTRAINT `ORDER_SHPREF_OHDR` FOREIGN KEY (`ORDER_ID`) REFERENCES `ORDER_HEADER` (`ORDER_ID`),
  CONSTRAINT `ORDER_SHPREF_SHMTP` FOREIGN KEY (`SHIPMENT_METHOD_TYPE_ID`) REFERENCES `SHIPMENT_METHOD_TYPE` (`SHIPMENT_METHOD_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ORDER_STATUS`
--

DROP TABLE IF EXISTS `ORDER_STATUS`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ORDER_STATUS` (
  `ORDER_STATUS_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `STATUS_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ORDER_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ORDER_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ORDER_PAYMENT_PREFERENCE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `STATUS_DATETIME` datetime DEFAULT NULL,
  `STATUS_USER_LOGIN` varchar(250) COLLATE latin1_general_cs DEFAULT NULL,
  `CHANGE_REASON` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`ORDER_STATUS_ID`),
  KEY `ORDER_STTS_STTS` (`STATUS_ID`),
  KEY `ORDER_STTS_OHDR` (`ORDER_ID`),
  KEY `ORDER_STTS_USER` (`STATUS_USER_LOGIN`),
  KEY `ORDR_STTS_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `ORDR_STTS_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `ORDER_STTS_OHDR` FOREIGN KEY (`ORDER_ID`) REFERENCES `ORDER_HEADER` (`ORDER_ID`),
  CONSTRAINT `ORDER_STTS_STTS` FOREIGN KEY (`STATUS_ID`) REFERENCES `STATUS_ITEM` (`STATUS_ID`),
  CONSTRAINT `ORDER_STTS_USER` FOREIGN KEY (`STATUS_USER_LOGIN`) REFERENCES `USER_LOGIN` (`USER_LOGIN_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ORDER_SUMMARY_ENTRY`
--

DROP TABLE IF EXISTS `ORDER_SUMMARY_ENTRY`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ORDER_SUMMARY_ENTRY` (
  `ENTRY_DATE` date NOT NULL,
  `PRODUCT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FACILITY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `TOTAL_QUANTITY` decimal(18,6) DEFAULT NULL,
  `GROSS_SALES` decimal(18,2) DEFAULT NULL,
  `PRODUCT_COST` decimal(18,2) DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`ENTRY_DATE`,`PRODUCT_ID`,`FACILITY_ID`),
  KEY `ORDER_SMENT_PROD` (`PRODUCT_ID`),
  KEY `ORDER_SMENT_FAC` (`FACILITY_ID`),
  KEY `ORR_SMR_ENR_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `ORR_SMR_ENR_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `ORDER_SMENT_FAC` FOREIGN KEY (`FACILITY_ID`) REFERENCES `FACILITY` (`FACILITY_ID`),
  CONSTRAINT `ORDER_SMENT_PROD` FOREIGN KEY (`PRODUCT_ID`) REFERENCES `PRODUCT` (`PRODUCT_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ORDER_TERM`
--

DROP TABLE IF EXISTS `ORDER_TERM`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ORDER_TERM` (
  `TERM_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ORDER_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ORDER_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `TERM_VALUE` decimal(18,2) DEFAULT NULL,
  `TERM_DAYS` decimal(20,0) DEFAULT NULL,
  `TEXT_VALUE` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `UOM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`TERM_TYPE_ID`,`ORDER_ID`,`ORDER_ITEM_SEQ_ID`),
  KEY `ORDER_TERM_UOM` (`UOM_ID`),
  KEY `ORDER_TERM_OHDR` (`ORDER_ID`),
  KEY `ORDER_TERM_TTYPE` (`TERM_TYPE_ID`),
  KEY `ORDER_TERM_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `ORDER_TERM_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `ORDER_TERM_OHDR` FOREIGN KEY (`ORDER_ID`) REFERENCES `ORDER_HEADER` (`ORDER_ID`),
  CONSTRAINT `ORDER_TERM_TTYPE` FOREIGN KEY (`TERM_TYPE_ID`) REFERENCES `TERM_TYPE` (`TERM_TYPE_ID`),
  CONSTRAINT `ORDER_TERM_UOM` FOREIGN KEY (`UOM_ID`) REFERENCES `UOM` (`UOM_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ORDER_TERM_ATTRIBUTE`
--

DROP TABLE IF EXISTS `ORDER_TERM_ATTRIBUTE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ORDER_TERM_ATTRIBUTE` (
  `TERM_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ORDER_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ORDER_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ATTR_NAME` varchar(60) COLLATE latin1_general_cs NOT NULL,
  `ATTR_VALUE` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`TERM_TYPE_ID`,`ORDER_ID`,`ORDER_ITEM_SEQ_ID`,`ATTR_NAME`),
  KEY `ORDER_TATTR_OTRM` (`TERM_TYPE_ID`,`ORDER_ID`,`ORDER_ITEM_SEQ_ID`),
  KEY `ORR_TRM_ATTT_TXSTP` (`LAST_UPDATED_TX_STAMP`),
  KEY `ORR_TRM_ATTT_TXCRS` (`CREATED_TX_STAMP`),
  CONSTRAINT `ORDER_TATTR_OTRM` FOREIGN KEY (`TERM_TYPE_ID`, `ORDER_ID`, `ORDER_ITEM_SEQ_ID`) REFERENCES `ORDER_TERM` (`TERM_TYPE_ID`, `ORDER_ID`, `ORDER_ITEM_SEQ_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
