-- Table structure for table `ORDER_TYPE`
--

DROP TABLE IF EXISTS `ORDER_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ORDER_TYPE` (
  `ORDER_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_TYPE_ID`),
  KEY `ORDER_TYPE_PARENT` (`PARENT_TYPE_ID`),
  KEY `ORDER_TYPE_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `ORDER_TYPE_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `ORDER_TYPE_PARENT` FOREIGN KEY (`PARENT_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_TYPE_ATTR`
--

DROP TABLE IF EXISTS `ORDER_TYPE_ATTR`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ORDER_TYPE_ATTR` (
  `ORDER_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_TYPE_ID`,`ATTR_NAME`),
  KEY `ORDER_TPAT_ORTYP` (`ORDER_TYPE_ID`),
  KEY `ORDR_TP_ATR_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `ORDR_TP_ATR_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `ORDER_TPAT_ORTYP` 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 `OTHER_DATA_RESOURCE`
--

DROP TABLE IF EXISTS `OTHER_DATA_RESOURCE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `OTHER_DATA_RESOURCE` (
  `DATA_RESOURCE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `DATA_RESOURCE_CONTENT` 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_OTHER` (`DATA_RESOURCE_ID`),
  KEY `OTHR_DT_RSC_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `OTHR_DT_RSC_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `DATA_REC_OTHER` 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 `PARTY`
--

DROP TABLE IF EXISTS `PARTY`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PARTY` (
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARTY_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `EXTERNAL_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PREFERRED_CURRENCY_UOM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `DESCRIPTION` longtext COLLATE latin1_general_cs,
  `STATUS_ID` varchar(20) 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,
  `DATA_SOURCE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `IS_UNREAD` 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 (`PARTY_ID`),
  KEY `PARTY_PTY_TYP` (`PARTY_TYPE_ID`),
  KEY `PARTY_CUL` (`CREATED_BY_USER_LOGIN`),
  KEY `PARTY_LMCUL` (`LAST_MODIFIED_BY_USER_LOGIN`),
  KEY `PARTY_PREF_CRNCY` (`PREFERRED_CURRENCY_UOM_ID`),
  KEY `PARTY_STATUSITM` (`STATUS_ID`),
  KEY `PARTY_DATSRC` (`DATA_SOURCE_ID`),
  KEY `PARTY_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `PARTY_TXCRTS` (`CREATED_TX_STAMP`),
  KEY `PARTYEXT_ID_IDX` (`EXTERNAL_ID`),
  CONSTRAINT `PARTY_CUL` FOREIGN KEY (`CREATED_BY_USER_LOGIN`) REFERENCES `USER_LOGIN` (`USER_LOGIN_ID`),
  CONSTRAINT `PARTY_DATSRC` FOREIGN KEY (`DATA_SOURCE_ID`) REFERENCES `DATA_SOURCE` (`DATA_SOURCE_ID`),
  CONSTRAINT `PARTY_LMCUL` FOREIGN KEY (`LAST_MODIFIED_BY_USER_LOGIN`) REFERENCES `USER_LOGIN` (`USER_LOGIN_ID`),
  CONSTRAINT `PARTY_PREF_CRNCY` FOREIGN KEY (`PREFERRED_CURRENCY_UOM_ID`) REFERENCES `UOM` (`UOM_ID`),
  CONSTRAINT `PARTY_PTY_TYP` FOREIGN KEY (`PARTY_TYPE_ID`) REFERENCES `PARTY_TYPE` (`PARTY_TYPE_ID`),
  CONSTRAINT `PARTY_STATUSITM` 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 `PARTY_ACCTG_PREFERENCE`
--

DROP TABLE IF EXISTS `PARTY_ACCTG_PREFERENCE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PARTY_ACCTG_PREFERENCE` (
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FISCAL_YEAR_START_MONTH` decimal(20,0) DEFAULT NULL,
  `FISCAL_YEAR_START_DAY` decimal(20,0) DEFAULT NULL,
  `TAX_FORM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `COGS_METHOD_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `BASE_CURRENCY_UOM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `INVOICE_SEQ_CUST_METH_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `INVOICE_ID_PREFIX` varchar(10) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_INVOICE_NUMBER` decimal(20,0) DEFAULT NULL,
  `LAST_INVOICE_RESTART_DATE` datetime DEFAULT NULL,
  `USE_INVOICE_ID_FOR_RETURNS` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `QUOTE_SEQ_CUST_METH_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `QUOTE_ID_PREFIX` varchar(10) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_QUOTE_NUMBER` decimal(20,0) DEFAULT NULL,
  `ORDER_SEQ_CUST_METH_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ORDER_ID_PREFIX` varchar(10) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_ORDER_NUMBER` decimal(20,0) DEFAULT NULL,
  `REFUND_PAYMENT_METHOD_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ERROR_GL_JOURNAL_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `INVOICE_SEQUENCE_ENUM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ORDER_SEQUENCE_ENUM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `QUOTE_SEQUENCE_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 (`PARTY_ID`),
  KEY `ACTG_PREF_PTY` (`PARTY_ID`),
  KEY `ACTGPREF_TAXFORM` (`TAX_FORM_ID`),
  KEY `ACTGPREF_COGS` (`COGS_METHOD_ID`),
  KEY `ACCTGPREF_CURNCY` (`BASE_CURRENCY_UOM_ID`),
  KEY `ACTGPREF_INVCM` (`INVOICE_SEQ_CUST_METH_ID`),
  KEY `ACTGPREF_QTECM` (`QUOTE_SEQ_CUST_METH_ID`),
  KEY `ACTGPREF_ODRCM` (`ORDER_SEQ_CUST_METH_ID`),
  KEY `ACTGPREF_PAYMTH` (`REFUND_PAYMENT_METHOD_ID`),
  KEY `ACTGPREF_GLJRNL` (`ERROR_GL_JOURNAL_ID`),
  KEY `ACTGPREF_INVSQ` (`INVOICE_SEQUENCE_ENUM_ID`),
  KEY `ACTGPREF_QTESQ` (`QUOTE_SEQUENCE_ENUM_ID`),
  KEY `ACTGPREF_ODRSQ` (`ORDER_SEQUENCE_ENUM_ID`),
  KEY `PRT_ACG_PRFC_TXSTP` (`LAST_UPDATED_TX_STAMP`),
  KEY `PRT_ACG_PRFC_TXCRS` (`CREATED_TX_STAMP`),
  CONSTRAINT `ACCTGPREF_CURNCY` FOREIGN KEY (`BASE_CURRENCY_UOM_ID`) REFERENCES `UOM` (`UOM_ID`),
  CONSTRAINT `ACTGPREF_COGS` FOREIGN KEY (`COGS_METHOD_ID`) REFERENCES `ENUMERATION` (`ENUM_ID`),
  CONSTRAINT `ACTGPREF_GLJRNL` FOREIGN KEY (`ERROR_GL_JOURNAL_ID`) REFERENCES `GL_JOURNAL` (`GL_JOURNAL_ID`),
  CONSTRAINT `ACTGPREF_INVCM` FOREIGN KEY (`INVOICE_SEQ_CUST_METH_ID`) REFERENCES `CUSTOM_METHOD` (`CUSTOM_METHOD_ID`),
  CONSTRAINT `ACTGPREF_INVSQ` FOREIGN KEY (`INVOICE_SEQUENCE_ENUM_ID`) REFERENCES `ENUMERATION` (`ENUM_ID`),
  CONSTRAINT `ACTGPREF_ODRCM` FOREIGN KEY (`ORDER_SEQ_CUST_METH_ID`) REFERENCES `CUSTOM_METHOD` (`CUSTOM_METHOD_ID`),
  CONSTRAINT `ACTGPREF_ODRSQ` FOREIGN KEY (`ORDER_SEQUENCE_ENUM_ID`) REFERENCES `ENUMERATION` (`ENUM_ID`),
  CONSTRAINT `ACTGPREF_PAYMTH` FOREIGN KEY (`REFUND_PAYMENT_METHOD_ID`) REFERENCES `PAYMENT_METHOD` (`PAYMENT_METHOD_ID`),
  CONSTRAINT `ACTGPREF_QTECM` FOREIGN KEY (`QUOTE_SEQ_CUST_METH_ID`) REFERENCES `CUSTOM_METHOD` (`CUSTOM_METHOD_ID`),
  CONSTRAINT `ACTGPREF_QTESQ` FOREIGN KEY (`QUOTE_SEQUENCE_ENUM_ID`) REFERENCES `ENUMERATION` (`ENUM_ID`),
  CONSTRAINT `ACTGPREF_TAXFORM` FOREIGN KEY (`TAX_FORM_ID`) REFERENCES `ENUMERATION` (`ENUM_ID`),
  CONSTRAINT `ACTG_PREF_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 `PARTY_ATTRIBUTE`
--

DROP TABLE IF EXISTS `PARTY_ATTRIBUTE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PARTY_ATTRIBUTE` (
  `PARTY_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 (`PARTY_ID`,`ATTR_NAME`),
  KEY `PARTY_ATTR` (`PARTY_ID`),
  KEY `PRT_ATTRBT_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `PRT_ATTRBT_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `PARTY_ATTR` 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 `PARTY_BENEFIT`
--

DROP TABLE IF EXISTS `PARTY_BENEFIT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PARTY_BENEFIT` (
  `ROLE_TYPE_ID_FROM` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ROLE_TYPE_ID_TO` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARTY_ID_FROM` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARTY_ID_TO` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `BENEFIT_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FROM_DATE` datetime NOT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `PERIOD_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `COST` decimal(18,2) DEFAULT NULL,
  `ACTUAL_EMPLOYER_PAID_PERCENT` double DEFAULT NULL,
  `AVAILABLE_TIME` 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 (`ROLE_TYPE_ID_FROM`,`ROLE_TYPE_ID_TO`,`PARTY_ID_FROM`,`PARTY_ID_TO`,`BENEFIT_TYPE_ID`,`FROM_DATE`),
  KEY `PTY_BNFT_TPTY` (`PARTY_ID_TO`),
  KEY `PTY_BNFT_TPTRL` (`PARTY_ID_TO`,`ROLE_TYPE_ID_TO`),
  KEY `PTY_BNFT_FPTY` (`PARTY_ID_FROM`),
  KEY `PTY_BNFT_FPTRL` (`PARTY_ID_FROM`,`ROLE_TYPE_ID_FROM`),
  KEY `PTY_BNFT_BNFTTP` (`BENEFIT_TYPE_ID`),
  KEY `PRT_BNFT_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `PRT_BNFT_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `PTY_BNFT_BNFTTP` FOREIGN KEY (`BENEFIT_TYPE_ID`) REFERENCES `BENEFIT_TYPE` (`BENEFIT_TYPE_ID`),
  CONSTRAINT `PTY_BNFT_FPTRL` FOREIGN KEY (`PARTY_ID_FROM`, `ROLE_TYPE_ID_FROM`) REFERENCES `PARTY_ROLE` (`PARTY_ID`, `ROLE_TYPE_ID`),
  CONSTRAINT `PTY_BNFT_FPTY` FOREIGN KEY (`PARTY_ID_FROM`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `PTY_BNFT_TPTRL` FOREIGN KEY (`PARTY_ID_TO`, `ROLE_TYPE_ID_TO`) REFERENCES `PARTY_ROLE` (`PARTY_ID`, `ROLE_TYPE_ID`),
  CONSTRAINT `PTY_BNFT_TPTY` FOREIGN KEY (`PARTY_ID_TO`) 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 `PARTY_CARRIER_ACCOUNT`
--

DROP TABLE IF EXISTS `PARTY_CARRIER_ACCOUNT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PARTY_CARRIER_ACCOUNT` (
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CARRIER_PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FROM_DATE` datetime NOT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `ACCOUNT_NUMBER` 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 (`PARTY_ID`,`CARRIER_PARTY_ID`,`FROM_DATE`),
  KEY `PARTY_CRRACT_PTY` (`PARTY_ID`),
  KEY `PARTY_CRRACT_CPT` (`CARRIER_PARTY_ID`),
  KEY `PRT_CRR_ACCT_TXSTP` (`LAST_UPDATED_TX_STAMP`),
  KEY `PRT_CRR_ACCT_TXCRS` (`CREATED_TX_STAMP`),
  CONSTRAINT `PARTY_CRRACT_CPT` FOREIGN KEY (`CARRIER_PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `PARTY_CRRACT_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 `PARTY_CLASSIFICATION`
--

DROP TABLE IF EXISTS `PARTY_CLASSIFICATION`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PARTY_CLASSIFICATION` (
  `PARTY_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 (`PARTY_ID`,`PARTY_CLASSIFICATION_GROUP_ID`,`FROM_DATE`),
  KEY `PARTY_CLASS_PARTY` (`PARTY_ID`),
  KEY `PARTY_CLASS_GRP` (`PARTY_CLASSIFICATION_GROUP_ID`),
  KEY `PRT_CLSSFCN_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `PRT_CLSSFCN_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `PARTY_CLASS_GRP` FOREIGN KEY (`PARTY_CLASSIFICATION_GROUP_ID`) REFERENCES `PARTY_CLASSIFICATION_GROUP` (`PARTY_CLASSIFICATION_GROUP_ID`),
  CONSTRAINT `PARTY_CLASS_PARTY` 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 `PARTY_CLASSIFICATION_GROUP`
--

DROP TABLE IF EXISTS `PARTY_CLASSIFICATION_GROUP`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PARTY_CLASSIFICATION_GROUP` (
  `PARTY_CLASSIFICATION_GROUP_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARTY_CLASSIFICATION_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PARENT_GROUP_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 (`PARTY_CLASSIFICATION_GROUP_ID`),
  KEY `PARTY_CLASS_GRPPAR` (`PARENT_GROUP_ID`),
  KEY `PARTY_CLSGRP_TYPE` (`PARTY_CLASSIFICATION_TYPE_ID`),
  KEY `PRT_CLSSN_GRP_TXSP` (`LAST_UPDATED_TX_STAMP`),
  KEY `PRT_CLSSN_GRP_TXCS` (`CREATED_TX_STAMP`),
  CONSTRAINT `PARTY_CLASS_GRPPAR` FOREIGN KEY (`PARENT_GROUP_ID`) REFERENCES `PARTY_CLASSIFICATION_GROUP` (`PARTY_CLASSIFICATION_GROUP_ID`),
  CONSTRAINT `PARTY_CLSGRP_TYPE` FOREIGN KEY (`PARTY_CLASSIFICATION_TYPE_ID`) REFERENCES `PARTY_CLASSIFICATION_TYPE` (`PARTY_CLASSIFICATION_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PARTY_CLASSIFICATION_TYPE`
--

DROP TABLE IF EXISTS `PARTY_CLASSIFICATION_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PARTY_CLASSIFICATION_TYPE` (
  `PARTY_CLASSIFICATION_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 (`PARTY_CLASSIFICATION_TYPE_ID`),
  KEY `PARTY_CLASS_TYPPAR` (`PARENT_TYPE_ID`),
  KEY `PRT_CLSSFN_TP_TXSP` (`LAST_UPDATED_TX_STAMP`),
  KEY `PRT_CLSSFN_TP_TXCS` (`CREATED_TX_STAMP`),
  CONSTRAINT `PARTY_CLASS_TYPPAR` FOREIGN KEY (`PARENT_TYPE_ID`) REFERENCES `PARTY_CLASSIFICATION_TYPE` (`PARTY_CLASSIFICATION_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PARTY_CONTACT_MECH`
--

DROP TABLE IF EXISTS `PARTY_CONTACT_MECH`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PARTY_CONTACT_MECH` (
  `PARTY_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,
  `ROLE_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ALLOW_SOLICITATION` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `EXTENSION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `VERIFIED` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `COMMENTS` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `YEARS_WITH_CONTACT_MECH` decimal(20,0) DEFAULT NULL,
  `MONTHS_WITH_CONTACT_MECH` 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 (`PARTY_ID`,`CONTACT_MECH_ID`,`FROM_DATE`),
  KEY `PARTY_CMECH_PARTY` (`PARTY_ID`),
  KEY `PARTY_CMECH_PROLE` (`PARTY_ID`,`ROLE_TYPE_ID`),
  KEY `PARTY_CMECH_ROLE` (`ROLE_TYPE_ID`),
  KEY `PARTY_CMECH_CMECH` (`CONTACT_MECH_ID`),
  KEY `PRT_CNTT_MCH_TXSTP` (`LAST_UPDATED_TX_STAMP`),
  KEY `PRT_CNTT_MCH_TXCRS` (`CREATED_TX_STAMP`),
  CONSTRAINT `PARTY_CMECH_CMECH` FOREIGN KEY (`CONTACT_MECH_ID`) REFERENCES `CONTACT_MECH` (`CONTACT_MECH_ID`),
  CONSTRAINT `PARTY_CMECH_PARTY` FOREIGN KEY (`PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `PARTY_CMECH_PROLE` FOREIGN KEY (`PARTY_ID`, `ROLE_TYPE_ID`) REFERENCES `PARTY_ROLE` (`PARTY_ID`, `ROLE_TYPE_ID`),
  CONSTRAINT `PARTY_CMECH_ROLE` 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 `PARTY_CONTACT_MECH_PURPOSE`
--

DROP TABLE IF EXISTS `PARTY_CONTACT_MECH_PURPOSE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PARTY_CONTACT_MECH_PURPOSE` (
  `PARTY_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 (`PARTY_ID`,`CONTACT_MECH_ID`,`CONTACT_MECH_PURPOSE_TYPE_ID`,`FROM_DATE`),
  KEY `PARTY_CMPRP_TYPE` (`CONTACT_MECH_PURPOSE_TYPE_ID`),
  KEY `PARTY_CMPRP_PARTY` (`PARTY_ID`),
  KEY `PARTY_CMPRP_CMECH` (`CONTACT_MECH_ID`),
  KEY `PRT_CNT_MCH_PRS_TP` (`LAST_UPDATED_TX_STAMP`),
  KEY `PRT_CNT_MCH_PRS_TS` (`CREATED_TX_STAMP`),
  CONSTRAINT `PARTY_CMPRP_CMECH` FOREIGN KEY (`CONTACT_MECH_ID`) REFERENCES `CONTACT_MECH` (`CONTACT_MECH_ID`),
  CONSTRAINT `PARTY_CMPRP_PARTY` FOREIGN KEY (`PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `PARTY_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 `PARTY_CONTENT`
--

DROP TABLE IF EXISTS `PARTY_CONTENT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PARTY_CONTENT` (
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CONTENT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARTY_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 (`PARTY_ID`,`CONTENT_ID`,`PARTY_CONTENT_TYPE_ID`,`FROM_DATE`),
  KEY `PARTY_CNT_PARTY` (`PARTY_ID`),
  KEY `PARTY_CNT_CNT` (`CONTENT_ID`),
  KEY `PARTY_CNT_TYPE` (`PARTY_CONTENT_TYPE_ID`),
  KEY `PRT_CNTNT_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `PRT_CNTNT_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `PARTY_CNT_CNT` FOREIGN KEY (`CONTENT_ID`) REFERENCES `CONTENT` (`CONTENT_ID`),
  CONSTRAINT `PARTY_CNT_PARTY` FOREIGN KEY (`PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `PARTY_CNT_TYPE` FOREIGN KEY (`PARTY_CONTENT_TYPE_ID`) REFERENCES `PARTY_CONTENT_TYPE` (`PARTY_CONTENT_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PARTY_CONTENT_TYPE`
--

DROP TABLE IF EXISTS `PARTY_CONTENT_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PARTY_CONTENT_TYPE` (
  `PARTY_CONTENT_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARENT_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 (`PARTY_CONTENT_TYPE_ID`),
  KEY `PARTYCNT_TP_PAR` (`PARENT_TYPE_ID`),
  KEY `PRT_CNTT_TP_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `PRT_CNTT_TP_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `PARTYCNT_TP_PAR` FOREIGN KEY (`PARENT_TYPE_ID`) REFERENCES `PARTY_CONTENT_TYPE` (`PARTY_CONTENT_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PARTY_DATA_SOURCE`
--

DROP TABLE IF EXISTS `PARTY_DATA_SOURCE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PARTY_DATA_SOURCE` (
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `DATA_SOURCE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FROM_DATE` datetime NOT NULL,
  `VISIT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `COMMENTS` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `IS_CREATE` 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 (`PARTY_ID`,`DATA_SOURCE_ID`,`FROM_DATE`),
  KEY `PARTY_DATSRC_PTY` (`PARTY_ID`),
  KEY `PARTY_DATSRC_DSC` (`DATA_SOURCE_ID`),
  KEY `PARTY_DATSRC_VST` (`VISIT_ID`),
  KEY `PRT_DT_SRC_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `PRT_DT_SRC_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `PARTY_DATSRC_DSC` FOREIGN KEY (`DATA_SOURCE_ID`) REFERENCES `DATA_SOURCE` (`DATA_SOURCE_ID`),
  CONSTRAINT `PARTY_DATSRC_PTY` FOREIGN KEY (`PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `PARTY_DATSRC_VST` 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 `PARTY_FIXED_ASSET_ASSIGNMENT`
--

DROP TABLE IF EXISTS `PARTY_FIXED_ASSET_ASSIGNMENT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PARTY_FIXED_ASSET_ASSIGNMENT` (
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ROLE_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FIXED_ASSET_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FROM_DATE` datetime NOT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `ALLOCATED_DATE` datetime DEFAULT NULL,
  `STATUS_ID` varchar(20) 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 (`PARTY_ID`,`ROLE_TYPE_ID`,`FIXED_ASSET_ID`,`FROM_DATE`),
  KEY `PTY_FASTAS_PTRL` (`PARTY_ID`,`ROLE_TYPE_ID`),
  KEY `PTY_FASTAS_FA` (`FIXED_ASSET_ID`),
  KEY `PTY_FASTAS_SI` (`STATUS_ID`),
  KEY `PRT_FXD_AST_AST_TP` (`LAST_UPDATED_TX_STAMP`),
  KEY `PRT_FXD_AST_AST_TS` (`CREATED_TX_STAMP`),
  CONSTRAINT `PTY_FASTAS_FA` FOREIGN KEY (`FIXED_ASSET_ID`) REFERENCES `FIXED_ASSET` (`FIXED_ASSET_ID`),
  CONSTRAINT `PTY_FASTAS_PTRL` FOREIGN KEY (`PARTY_ID`, `ROLE_TYPE_ID`) REFERENCES `PARTY_ROLE` (`PARTY_ID`, `ROLE_TYPE_ID`),
  CONSTRAINT `PTY_FASTAS_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 `PARTY_GEO_POINT`
--

DROP TABLE IF EXISTS `PARTY_GEO_POINT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PARTY_GEO_POINT` (
  `PARTY_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 (`PARTY_ID`,`GEO_POINT_ID`,`FROM_DATE`),
  KEY `PARTYGEOPT_PARTY` (`PARTY_ID`),
  KEY `PARTYGEOPT_GEOPT` (`GEO_POINT_ID`),
  KEY `PRT_G_PNT_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `PRT_G_PNT_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `PARTYGEOPT_GEOPT` FOREIGN KEY (`GEO_POINT_ID`) REFERENCES `GEO_POINT` (`GEO_POINT_ID`),
  CONSTRAINT `PARTYGEOPT_PARTY` 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 `PARTY_GL_ACCOUNT`
--

DROP TABLE IF EXISTS `PARTY_GL_ACCOUNT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PARTY_GL_ACCOUNT` (
  `ORGANIZATION_PARTY_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,
  `GL_ACCOUNT_TYPE_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 (`ORGANIZATION_PARTY_ID`,`PARTY_ID`,`ROLE_TYPE_ID`,`GL_ACCOUNT_TYPE_ID`),
  KEY `PRTYGLACCT_ORGPRTY` (`ORGANIZATION_PARTY_ID`),
  KEY `PRTYGLACCT_PRTY` (`PARTY_ID`),
  KEY `PRTYGLACCT_PTRL` (`PARTY_ID`,`ROLE_TYPE_ID`),
  KEY `PRTYGLACCT_GLAT` (`GL_ACCOUNT_TYPE_ID`),
  KEY `PRTYGLACCT_GLACCT` (`GL_ACCOUNT_ID`),
  KEY `PRT_GL_ACCT_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `PRT_GL_ACCT_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `PRTYGLACCT_GLACCT` FOREIGN KEY (`GL_ACCOUNT_ID`) REFERENCES `GL_ACCOUNT` (`GL_ACCOUNT_ID`),
  CONSTRAINT `PRTYGLACCT_GLAT` FOREIGN KEY (`GL_ACCOUNT_TYPE_ID`) REFERENCES `GL_ACCOUNT_TYPE` (`GL_ACCOUNT_TYPE_ID`),
  CONSTRAINT `PRTYGLACCT_ORGPRTY` FOREIGN KEY (`ORGANIZATION_PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `PRTYGLACCT_PRTY` FOREIGN KEY (`PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `PRTYGLACCT_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 `PARTY_GROUP`
--

DROP TABLE IF EXISTS `PARTY_GROUP`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PARTY_GROUP` (
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `GROUP_NAME` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `GROUP_NAME_LOCAL` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `OFFICE_SITE_NAME` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `ANNUAL_REVENUE` decimal(18,2) DEFAULT NULL,
  `NUM_EMPLOYEES` decimal(20,0) DEFAULT NULL,
  `TICKER_SYMBOL` varchar(10) COLLATE latin1_general_cs DEFAULT NULL,
  `COMMENTS` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LOGO_IMAGE_URL` 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 (`PARTY_ID`),
  KEY `PARTY_GRP_PARTY` (`PARTY_ID`),
  KEY `PARTY_GROUP_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `PARTY_GROUP_TXCRTS` (`CREATED_TX_STAMP`),
  KEY `GROUP_NAME_IDX` (`GROUP_NAME`),
  CONSTRAINT `PARTY_GRP_PARTY` 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 `PARTY_ICS_AVS_OVERRIDE`
--

DROP TABLE IF EXISTS `PARTY_ICS_AVS_OVERRIDE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PARTY_ICS_AVS_OVERRIDE` (
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `AVS_DECLINE_STRING` 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 (`PARTY_ID`),
  KEY `PARTY_ICSAVS_PARTY` (`PARTY_ID`),
  KEY `PRT_ICS_AVS_OVD_TP` (`LAST_UPDATED_TX_STAMP`),
  KEY `PRT_ICS_AVS_OVD_TS` (`CREATED_TX_STAMP`),
  CONSTRAINT `PARTY_ICSAVS_PARTY` 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 `PARTY_IDENTIFICATION`
--

DROP TABLE IF EXISTS `PARTY_IDENTIFICATION`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PARTY_IDENTIFICATION` (
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARTY_IDENTIFICATION_TYPE_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 (`PARTY_ID`,`PARTY_IDENTIFICATION_TYPE_ID`),
  KEY `PARTY_ID_TYPE` (`PARTY_IDENTIFICATION_TYPE_ID`),
  KEY `PARTY_ID_PRODICT` (`PARTY_ID`),
  KEY `PRT_IDNTFCN_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `PRT_IDNTFCN_TXCRTS` (`CREATED_TX_STAMP`),
  KEY `PARTY_ID_VALIDX` (`ID_VALUE`),
  CONSTRAINT `PARTY_ID_PRODICT` FOREIGN KEY (`PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `PARTY_ID_TYPE` FOREIGN KEY (`PARTY_IDENTIFICATION_TYPE_ID`) REFERENCES `PARTY_IDENTIFICATION_TYPE` (`PARTY_IDENTIFICATION_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PARTY_IDENTIFICATION_TYPE`
--

DROP TABLE IF EXISTS `PARTY_IDENTIFICATION_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PARTY_IDENTIFICATION_TYPE` (
  `PARTY_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 (`PARTY_IDENTIFICATION_TYPE_ID`),
  KEY `PARTY_ID_TYPE_PAR` (`PARENT_TYPE_ID`),
  KEY `PRT_IDNTFN_TP_TXSP` (`LAST_UPDATED_TX_STAMP`),
  KEY `PRT_IDNTFN_TP_TXCS` (`CREATED_TX_STAMP`),
  CONSTRAINT `PARTY_ID_TYPE_PAR` FOREIGN KEY (`PARENT_TYPE_ID`) REFERENCES `PARTY_IDENTIFICATION_TYPE` (`PARTY_IDENTIFICATION_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PARTY_INVITATION`
--

DROP TABLE IF EXISTS `PARTY_INVITATION`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PARTY_INVITATION` (
  `PARTY_INVITATION_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARTY_ID_FROM` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `TO_NAME` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `EMAIL_ADDRESS` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `STATUS_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_INVITE_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 (`PARTY_INVITATION_ID`),
  KEY `PTYINV_PTY` (`PARTY_ID_FROM`),
  KEY `PTYINV_STTS` (`STATUS_ID`),
  KEY `PRT_INVTTN_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `PRT_INVTTN_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `PTYINV_PTY` FOREIGN KEY (`PARTY_ID_FROM`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `PTYINV_STTS` 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 `PARTY_INVITATION_GROUP_ASSOC`
--

DROP TABLE IF EXISTS `PARTY_INVITATION_GROUP_ASSOC`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PARTY_INVITATION_GROUP_ASSOC` (
  `PARTY_INVITATION_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARTY_ID_TO` 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 (`PARTY_INVITATION_ID`,`PARTY_ID_TO`),
  KEY `PTYINVGA_PTYGRP` (`PARTY_ID_TO`),
  KEY `PTYINVGA_PTYTO` (`PARTY_ID_TO`),
  KEY `PTYINVGA_PTYINV` (`PARTY_INVITATION_ID`),
  KEY `PRT_INN_GRP_ASC_TP` (`LAST_UPDATED_TX_STAMP`),
  KEY `PRT_INN_GRP_ASC_TS` (`CREATED_TX_STAMP`),
  CONSTRAINT `PTYINVGA_PTYGRP` FOREIGN KEY (`PARTY_ID_TO`) REFERENCES `PARTY_GROUP` (`PARTY_ID`),
  CONSTRAINT `PTYINVGA_PTYINV` FOREIGN KEY (`PARTY_INVITATION_ID`) REFERENCES `PARTY_INVITATION` (`PARTY_INVITATION_ID`),
  CONSTRAINT `PTYINVGA_PTYTO` FOREIGN KEY (`PARTY_ID_TO`) 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 `PARTY_INVITATION_ROLE_ASSOC`
--

DROP TABLE IF EXISTS `PARTY_INVITATION_ROLE_ASSOC`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PARTY_INVITATION_ROLE_ASSOC` (
  `PARTY_INVITATION_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 (`PARTY_INVITATION_ID`,`ROLE_TYPE_ID`),
  KEY `PTYINVROLE_ROLET` (`ROLE_TYPE_ID`),
  KEY `PTYINVROLE_PTYINV` (`PARTY_INVITATION_ID`),
  KEY `PRT_INN_RL_ASC_TXP` (`LAST_UPDATED_TX_STAMP`),
  KEY `PRT_INN_RL_ASC_TXS` (`CREATED_TX_STAMP`),
  CONSTRAINT `PTYINVROLE_PTYINV` FOREIGN KEY (`PARTY_INVITATION_ID`) REFERENCES `PARTY_INVITATION` (`PARTY_INVITATION_ID`),
  CONSTRAINT `PTYINVROLE_ROLET` 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 `PARTY_NAME_HISTORY`
--

DROP TABLE IF EXISTS `PARTY_NAME_HISTORY`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PARTY_NAME_HISTORY` (
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CHANGE_DATE` datetime NOT NULL,
  `GROUP_NAME` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `FIRST_NAME` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `MIDDLE_NAME` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_NAME` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `PERSONAL_TITLE` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `SUFFIX` 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 (`PARTY_ID`,`CHANGE_DATE`),
  KEY `PTY_NMHIS_PARTY` (`PARTY_ID`),
  KEY `PRT_NM_HSTR_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `PRT_NM_HSTR_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `PTY_NMHIS_PARTY` 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 `PARTY_NEED`
--

DROP TABLE IF EXISTS `PARTY_NEED`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PARTY_NEED` (
  `PARTY_NEED_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,
  `PARTY_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `NEED_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `COMMUNICATION_EVENT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PRODUCT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PRODUCT_CATEGORY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `VISIT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `DATETIME_RECORDED` datetime 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 (`PARTY_NEED_ID`,`PARTY_ID`,`ROLE_TYPE_ID`),
  KEY `PARTY_NEED_NDTP` (`NEED_TYPE_ID`),
  KEY `PARTY_NEED_PTY` (`PARTY_ID`),
  KEY `PARTY_NEED_RTYP` (`ROLE_TYPE_ID`),
  KEY `PARTY_NEED_PTTP` (`PARTY_TYPE_ID`),
  KEY `PARTY_NEED_CMEV` (`COMMUNICATION_EVENT_ID`),
  KEY `PARTY_NEED_PROD` (`PRODUCT_ID`),
  KEY `PARTY_NEED_PCAT` (`PRODUCT_CATEGORY_ID`),
  KEY `PARTY_NEED_VSIT` (`VISIT_ID`),
  KEY `PARTY_NEED_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `PARTY_NEED_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `PARTY_NEED_CMEV` FOREIGN KEY (`COMMUNICATION_EVENT_ID`) REFERENCES `COMMUNICATION_EVENT` (`COMMUNICATION_EVENT_ID`),
  CONSTRAINT `PARTY_NEED_NDTP` FOREIGN KEY (`NEED_TYPE_ID`) REFERENCES `NEED_TYPE` (`NEED_TYPE_ID`),
  CONSTRAINT `PARTY_NEED_PCAT` FOREIGN KEY (`PRODUCT_CATEGORY_ID`) REFERENCES `PRODUCT_CATEGORY` (`PRODUCT_CATEGORY_ID`),
  CONSTRAINT `PARTY_NEED_PROD` FOREIGN KEY (`PRODUCT_ID`) REFERENCES `PRODUCT` (`PRODUCT_ID`),
  CONSTRAINT `PARTY_NEED_PTTP` FOREIGN KEY (`PARTY_TYPE_ID`) REFERENCES `PARTY_TYPE` (`PARTY_TYPE_ID`),
  CONSTRAINT `PARTY_NEED_PTY` FOREIGN KEY (`PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `PARTY_NEED_RTYP` FOREIGN KEY (`ROLE_TYPE_ID`) REFERENCES `ROLE_TYPE` (`ROLE_TYPE_ID`),
  CONSTRAINT `PARTY_NEED_VSIT` 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 `PARTY_NOTE`
--

DROP TABLE IF EXISTS `PARTY_NOTE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PARTY_NOTE` (
  `PARTY_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 (`PARTY_ID`,`NOTE_ID`),
  KEY `PARTY_NOTE_PARTY` (`PARTY_ID`),
  KEY `PARTY_NOTE_NOTE` (`NOTE_ID`),
  KEY `PARTY_NOTE_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `PARTY_NOTE_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `PARTY_NOTE_NOTE` FOREIGN KEY (`NOTE_ID`) REFERENCES `NOTE_DATA` (`NOTE_ID`),
  CONSTRAINT `PARTY_NOTE_PARTY` 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 `PARTY_PROFILE_DEFAULT`
--

DROP TABLE IF EXISTS `PARTY_PROFILE_DEFAULT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PARTY_PROFILE_DEFAULT` (
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_STORE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `DEFAULT_SHIP_ADDR` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `DEFAULT_BILL_ADDR` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `DEFAULT_PAY_METH` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `DEFAULT_SHIP_METH` 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 (`PARTY_ID`,`PRODUCT_STORE_ID`),
  KEY `PARTY_PROF_PARTY` (`PARTY_ID`),
  KEY `PARTY_PROF_PSTORE` (`PRODUCT_STORE_ID`),
  KEY `PRT_PRL_DFT_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `PRT_PRL_DFT_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `PARTY_PROF_PARTY` FOREIGN KEY (`PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `PARTY_PROF_PSTORE` FOREIGN KEY (`PRODUCT_STORE_ID`) REFERENCES `PRODUCT_STORE` (`PRODUCT_STORE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PARTY_QUAL`
--

DROP TABLE IF EXISTS `PARTY_QUAL`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PARTY_QUAL` (
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARTY_QUAL_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `QUALIFICATION_DESC` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `TITLE` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `STATUS_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `VERIF_STATUS_ID` varchar(20) COLLATE latin1_general_cs DEFAULT 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 (`PARTY_ID`,`PARTY_QUAL_TYPE_ID`,`FROM_DATE`),
  KEY `PARTY_QUAL_PRTY` (`PARTY_ID`),
  KEY `PARTY_QUAL_PQTYP` (`PARTY_QUAL_TYPE_ID`),
  KEY `PARTY_QUAL_STATUS` (`STATUS_ID`),
  KEY `PARTY_QUAL_VERIF` (`VERIF_STATUS_ID`),
  KEY `PARTY_QUAL_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `PARTY_QUAL_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `PARTY_QUAL_PQTYP` FOREIGN KEY (`PARTY_QUAL_TYPE_ID`) REFERENCES `PARTY_QUAL_TYPE` (`PARTY_QUAL_TYPE_ID`),
  CONSTRAINT `PARTY_QUAL_PRTY` FOREIGN KEY (`PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `PARTY_QUAL_STATUS` FOREIGN KEY (`STATUS_ID`) REFERENCES `STATUS_ITEM` (`STATUS_ID`),
  CONSTRAINT `PARTY_QUAL_VERIF` FOREIGN KEY (`VERIF_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 `PARTY_QUAL_TYPE`
--

DROP TABLE IF EXISTS `PARTY_QUAL_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PARTY_QUAL_TYPE` (
  `PARTY_QUAL_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 (`PARTY_QUAL_TYPE_ID`),
  KEY `PARTY_QUAL_TPAR` (`PARENT_TYPE_ID`),
  KEY `PRT_QL_TP_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `PRT_QL_TP_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `PARTY_QUAL_TPAR` FOREIGN KEY (`PARENT_TYPE_ID`) REFERENCES `PARTY_QUAL_TYPE` (`PARTY_QUAL_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PARTY_RATE`
--

DROP TABLE IF EXISTS `PARTY_RATE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PARTY_RATE` (
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `RATE_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CURRENCY_UOM_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `DEFAULT_RATE` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `FROM_DATE` datetime NOT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `RATE` 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 (`PARTY_ID`,`RATE_TYPE_ID`,`CURRENCY_UOM_ID`,`FROM_DATE`),
  KEY `OPRTY_RTE_PRTY` (`PARTY_ID`),
  KEY `OPRTY_RTE_RTTP` (`RATE_TYPE_ID`),
  KEY `OPARTY_RATE_CUOM` (`CURRENCY_UOM_ID`),
  KEY `PARTY_RATE_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `PARTY_RATE_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `OPARTY_RATE_CUOM` FOREIGN KEY (`CURRENCY_UOM_ID`) REFERENCES `UOM` (`UOM_ID`),
  CONSTRAINT `OPRTY_RTE_PRTY` FOREIGN KEY (`PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `OPRTY_RTE_RTTP` FOREIGN KEY (`RATE_TYPE_ID`) REFERENCES `RATE_TYPE` (`RATE_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PARTY_RATE_NEW`
--

DROP TABLE IF EXISTS `PARTY_RATE_NEW`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PARTY_RATE_NEW` (
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `RATE_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `DEFAULT_RATE` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `PERCENTAGE_USED` double DEFAULT 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 (`PARTY_ID`,`RATE_TYPE_ID`,`FROM_DATE`),
  KEY `PRTY_RATE_PRTY` (`PARTY_ID`),
  KEY `PRTY_RATE_RTTP` (`RATE_TYPE_ID`),
  KEY `PRT_RT_NW_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `PRT_RT_NW_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `PRTY_RATE_PRTY` FOREIGN KEY (`PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `PRTY_RATE_RTTP` FOREIGN KEY (`RATE_TYPE_ID`) REFERENCES `RATE_TYPE` (`RATE_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PARTY_RELATIONSHIP`
--

DROP TABLE IF EXISTS `PARTY_RELATIONSHIP`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PARTY_RELATIONSHIP` (
  `PARTY_ID_FROM` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARTY_ID_TO` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ROLE_TYPE_ID_FROM` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ROLE_TYPE_ID_TO` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FROM_DATE` datetime NOT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `STATUS_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `RELATIONSHIP_NAME` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `SECURITY_GROUP_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PRIORITY_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PARTY_RELATIONSHIP_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PERMISSIONS_ENUM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `POSITION_TITLE` varchar(100) 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 (`PARTY_ID_FROM`,`PARTY_ID_TO`,`ROLE_TYPE_ID_FROM`,`ROLE_TYPE_ID_TO`,`FROM_DATE`),
  KEY `PARTY_REL_FPROLE` (`PARTY_ID_FROM`,`ROLE_TYPE_ID_FROM`),
  KEY `PARTY_REL_TPROLE` (`PARTY_ID_TO`,`ROLE_TYPE_ID_TO`),
  KEY `PARTY_REL_STTS` (`STATUS_ID`),
  KEY `PARTY_REL_PRTYP` (`PRIORITY_TYPE_ID`),
  KEY `PARTY_REL_TYPE` (`PARTY_RELATIONSHIP_TYPE_ID`),
  KEY `PARTY_REL_SECGRP` (`SECURITY_GROUP_ID`),
  KEY `PRT_RLTNSHP_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `PRT_RLTNSHP_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `PARTY_REL_FPROLE` FOREIGN KEY (`PARTY_ID_FROM`, `ROLE_TYPE_ID_FROM`) REFERENCES `PARTY_ROLE` (`PARTY_ID`, `ROLE_TYPE_ID`),
  CONSTRAINT `PARTY_REL_PRTYP` FOREIGN KEY (`PRIORITY_TYPE_ID`) REFERENCES `PRIORITY_TYPE` (`PRIORITY_TYPE_ID`),
  CONSTRAINT `PARTY_REL_SECGRP` FOREIGN KEY (`SECURITY_GROUP_ID`) REFERENCES `SECURITY_GROUP` (`GROUP_ID`),
  CONSTRAINT `PARTY_REL_STTS` FOREIGN KEY (`STATUS_ID`) REFERENCES `STATUS_ITEM` (`STATUS_ID`),
  CONSTRAINT `PARTY_REL_TPROLE` FOREIGN KEY (`PARTY_ID_TO`, `ROLE_TYPE_ID_TO`) REFERENCES `PARTY_ROLE` (`PARTY_ID`, `ROLE_TYPE_ID`),
  CONSTRAINT `PARTY_REL_TYPE` FOREIGN KEY (`PARTY_RELATIONSHIP_TYPE_ID`) REFERENCES `PARTY_RELATIONSHIP_TYPE` (`PARTY_RELATIONSHIP_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PARTY_RELATIONSHIP_TYPE`
--

DROP TABLE IF EXISTS `PARTY_RELATIONSHIP_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PARTY_RELATIONSHIP_TYPE` (
  `PARTY_RELATIONSHIP_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,
  `PARTY_RELATIONSHIP_NAME` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `ROLE_TYPE_ID_VALID_FROM` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ROLE_TYPE_ID_VALID_TO` 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 (`PARTY_RELATIONSHIP_TYPE_ID`),
  KEY `PARTY_RELTYP_PAR` (`PARENT_TYPE_ID`),
  KEY `PARTY_RELTYP_VFRT` (`ROLE_TYPE_ID_VALID_FROM`),
  KEY `PARTY_RELTYP_VTRT` (`ROLE_TYPE_ID_VALID_TO`),
  KEY `PRT_RLTNP_TP_TXSTP` (`LAST_UPDATED_TX_STAMP`),
  KEY `PRT_RLTNP_TP_TXCRS` (`CREATED_TX_STAMP`),
  CONSTRAINT `PARTY_RELTYP_PAR` FOREIGN KEY (`PARENT_TYPE_ID`) REFERENCES `PARTY_RELATIONSHIP_TYPE` (`PARTY_RELATIONSHIP_TYPE_ID`),
  CONSTRAINT `PARTY_RELTYP_VFRT` FOREIGN KEY (`ROLE_TYPE_ID_VALID_FROM`) REFERENCES `ROLE_TYPE` (`ROLE_TYPE_ID`),
  CONSTRAINT `PARTY_RELTYP_VTRT` FOREIGN KEY (`ROLE_TYPE_ID_VALID_TO`) 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 `PARTY_RESUME`
--

DROP TABLE IF EXISTS `PARTY_RESUME`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PARTY_RESUME` (
  `RESUME_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `CONTENT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `RESUME_DATE` datetime DEFAULT NULL,
  `RESUME_TEXT` 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 (`RESUME_ID`),
  KEY `PARTY_RSME_PRTY` (`PARTY_ID`),
  KEY `PRT_RSM_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `PRT_RSM_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `PARTY_RSME_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 `PARTY_ROLE`
--

DROP TABLE IF EXISTS `PARTY_ROLE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PARTY_ROLE` (
  `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 (`PARTY_ID`,`ROLE_TYPE_ID`),
  KEY `PARTY_RLE_PARTY` (`PARTY_ID`),
  KEY `PARTY_RLE_ROLE` (`ROLE_TYPE_ID`),
  KEY `PARTY_ROLE_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `PARTY_ROLE_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `PARTY_RLE_PARTY` FOREIGN KEY (`PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `PARTY_RLE_ROLE` 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 `PARTY_SKILL`
--

DROP TABLE IF EXISTS `PARTY_SKILL`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PARTY_SKILL` (
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `SKILL_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `YEARS_EXPERIENCE` decimal(20,0) DEFAULT NULL,
  `RATING` decimal(20,0) DEFAULT NULL,
  `SKILL_LEVEL` decimal(20,0) DEFAULT NULL,
  `STARTED_USING_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 (`PARTY_ID`,`SKILL_TYPE_ID`),
  KEY `PARTY_SKLL_PRTY` (`PARTY_ID`),
  KEY `PARTY_SKLL_SKTP` (`SKILL_TYPE_ID`),
  KEY `PARTY_SKILL_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `PARTY_SKILL_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `PARTY_SKLL_PRTY` FOREIGN KEY (`PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `PARTY_SKLL_SKTP` 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 `PARTY_STATUS`
--

DROP TABLE IF EXISTS `PARTY_STATUS`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PARTY_STATUS` (
  `STATUS_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARTY_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`,`PARTY_ID`,`STATUS_DATE`),
  KEY `PARTY_STS_STSITM` (`STATUS_ID`),
  KEY `PARTY_STS_PARTY` (`PARTY_ID`),
  KEY `PRT_STTS_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `PRT_STTS_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `PARTY_STS_PARTY` FOREIGN KEY (`PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `PARTY_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 `PARTY_TAX_AUTH_INFO`
--

DROP TABLE IF EXISTS `PARTY_TAX_AUTH_INFO`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PARTY_TAX_AUTH_INFO` (
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `TAX_AUTH_GEO_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `TAX_AUTH_PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FROM_DATE` datetime NOT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `PARTY_TAX_ID` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `IS_EXEMPT` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `IS_NEXUS` 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 (`PARTY_ID`,`TAX_AUTH_GEO_ID`,`TAX_AUTH_PARTY_ID`,`FROM_DATE`),
  KEY `PARTY_TXAI_PTY` (`PARTY_ID`),
  KEY `PARTY_TXAI_TXA` (`TAX_AUTH_GEO_ID`,`TAX_AUTH_PARTY_ID`),
  KEY `PRT_TX_ATH_INF_TXP` (`LAST_UPDATED_TX_STAMP`),
  KEY `PRT_TX_ATH_INF_TXS` (`CREATED_TX_STAMP`),
  CONSTRAINT `PARTY_TXAI_PTY` FOREIGN KEY (`PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `PARTY_TXAI_TXA` FOREIGN KEY (`TAX_AUTH_GEO_ID`, `TAX_AUTH_PARTY_ID`) REFERENCES `TAX_AUTHORITY` (`TAX_AUTH_GEO_ID`, `TAX_AUTH_PARTY_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PARTY_TAX_INFO`
--

DROP TABLE IF EXISTS `PARTY_TAX_INFO`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PARTY_TAX_INFO` (
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `GEO_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FROM_DATE` datetime NOT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `PARTY_TAX_ID` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `IS_EXEMPT` 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 (`PARTY_ID`,`GEO_ID`,`FROM_DATE`),
  KEY `PARTY_TXI_PTY` (`PARTY_ID`),
  KEY `PARTY_TXI_GEO` (`GEO_ID`),
  KEY `PRT_TX_INF_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `PRT_TX_INF_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `PARTY_TXI_GEO` FOREIGN KEY (`GEO_ID`) REFERENCES `GEO` (`GEO_ID`),
  CONSTRAINT `PARTY_TXI_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 `PARTY_TYPE`
--

DROP TABLE IF EXISTS `PARTY_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PARTY_TYPE` (
  `PARTY_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 (`PARTY_TYPE_ID`),
  KEY `PARTY_TYPE_PAR` (`PARENT_TYPE_ID`),
  KEY `PARTY_TYPE_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `PARTY_TYPE_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `PARTY_TYPE_PAR` FOREIGN KEY (`PARENT_TYPE_ID`) REFERENCES `PARTY_TYPE` (`PARTY_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PARTY_TYPE_ATTR`
--

DROP TABLE IF EXISTS `PARTY_TYPE_ATTR`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PARTY_TYPE_ATTR` (
  `PARTY_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 (`PARTY_TYPE_ID`,`ATTR_NAME`),
  KEY `PARTY_TYP_ATTR` (`PARTY_TYPE_ID`),
  KEY `PRT_TP_ATTR_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `PRT_TP_ATTR_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `PARTY_TYP_ATTR` FOREIGN KEY (`PARTY_TYPE_ID`) REFERENCES `PARTY_TYPE` (`PARTY_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PAYMENT`
--

DROP TABLE IF EXISTS `PAYMENT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PAYMENT` (
  `PAYMENT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PAYMENT_TYPE_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,
  `PAYMENT_GATEWAY_RESPONSE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PAYMENT_PREFERENCE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PARTY_ID_FROM` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PARTY_ID_TO` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ROLE_TYPE_ID_TO` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `STATUS_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `EFFECTIVE_DATE` datetime DEFAULT NULL,
  `PAYMENT_REF_NUM` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `AMOUNT` decimal(18,2) DEFAULT NULL,
  `CURRENCY_UOM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `COMMENTS` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `FIN_ACCOUNT_TRANS_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `OVERRIDE_GL_ACCOUNT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ACTUAL_CURRENCY_AMOUNT` decimal(18,2) DEFAULT NULL,
  `ACTUAL_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,
  PRIMARY KEY (`PAYMENT_ID`),
  KEY `PAYMENT_PMTYP` (`PAYMENT_TYPE_ID`),
  KEY `PAYMENT_PMETH_TP` (`PAYMENT_METHOD_TYPE_ID`),
  KEY `PAYMENT_PMETH` (`PAYMENT_METHOD_ID`),
  KEY `PAYMENT_CUOM` (`CURRENCY_UOM_ID`),
  KEY `PAYMENT_ACUOM` (`ACTUAL_CURRENCY_UOM_ID`),
  KEY `PAYMENT_ORDPMPRF` (`PAYMENT_PREFERENCE_ID`),
  KEY `PAYMENT_PAYGATR` (`PAYMENT_GATEWAY_RESPONSE_ID`),
  KEY `PAYMENT_FPTY` (`PARTY_ID_FROM`),
  KEY `PAYMENT_TPTY` (`PARTY_ID_TO`),
  KEY `PAYMENT_TRTP` (`ROLE_TYPE_ID_TO`),
  KEY `PAYMENT_STTSITM` (`STATUS_ID`),
  KEY `PAYMENT_FACTX` (`FIN_ACCOUNT_TRANS_ID`),
  KEY `PAYMENT_ORGLA` (`OVERRIDE_GL_ACCOUNT_ID`),
  KEY `PAYMENT_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `PAYMENT_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `PAYMENT_ACUOM` FOREIGN KEY (`ACTUAL_CURRENCY_UOM_ID`) REFERENCES `UOM` (`UOM_ID`),
  CONSTRAINT `PAYMENT_CUOM` FOREIGN KEY (`CURRENCY_UOM_ID`) REFERENCES `UOM` (`UOM_ID`),
  CONSTRAINT `PAYMENT_FACTX` FOREIGN KEY (`FIN_ACCOUNT_TRANS_ID`) REFERENCES `FIN_ACCOUNT_TRANS` (`FIN_ACCOUNT_TRANS_ID`),
  CONSTRAINT `PAYMENT_FPTY` FOREIGN KEY (`PARTY_ID_FROM`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `PAYMENT_ORDPMPRF` FOREIGN KEY (`PAYMENT_PREFERENCE_ID`) REFERENCES `ORDER_PAYMENT_PREFERENCE` (`ORDER_PAYMENT_PREFERENCE_ID`),
  CONSTRAINT `PAYMENT_ORGLA` FOREIGN KEY (`OVERRIDE_GL_ACCOUNT_ID`) REFERENCES `GL_ACCOUNT` (`GL_ACCOUNT_ID`),
  CONSTRAINT `PAYMENT_PAYGATR` FOREIGN KEY (`PAYMENT_GATEWAY_RESPONSE_ID`) REFERENCES `PAYMENT_GATEWAY_RESPONSE` (`PAYMENT_GATEWAY_RESPONSE_ID`),
  CONSTRAINT `PAYMENT_PMETH` FOREIGN KEY (`PAYMENT_METHOD_ID`) REFERENCES `PAYMENT_METHOD` (`PAYMENT_METHOD_ID`),
  CONSTRAINT `PAYMENT_PMETH_TP` FOREIGN KEY (`PAYMENT_METHOD_TYPE_ID`) REFERENCES `PAYMENT_METHOD_TYPE` (`PAYMENT_METHOD_TYPE_ID`),
  CONSTRAINT `PAYMENT_PMTYP` FOREIGN KEY (`PAYMENT_TYPE_ID`) REFERENCES `PAYMENT_TYPE` (`PAYMENT_TYPE_ID`),
  CONSTRAINT `PAYMENT_STTSITM` FOREIGN KEY (`STATUS_ID`) REFERENCES `STATUS_ITEM` (`STATUS_ID`),
  CONSTRAINT `PAYMENT_TPTY` FOREIGN KEY (`PARTY_ID_TO`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `PAYMENT_TRTP` FOREIGN KEY (`ROLE_TYPE_ID_TO`) 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 `PAYMENT_APPLICATION`
--

DROP TABLE IF EXISTS `PAYMENT_APPLICATION`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PAYMENT_APPLICATION` (
  `PAYMENT_APPLICATION_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PAYMENT_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,
  `BILLING_ACCOUNT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `OVERRIDE_GL_ACCOUNT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `TO_PAYMENT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `TAX_AUTH_GEO_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `AMOUNT_APPLIED` 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 (`PAYMENT_APPLICATION_ID`),
  KEY `PAYMENT_APP_PMT` (`PAYMENT_ID`),
  KEY `PAYMENT_APP_INV` (`INVOICE_ID`),
  KEY `PAYMENT_APP_BACT` (`BILLING_ACCOUNT_ID`),
  KEY `PAYMENT_APP_TPMT` (`TO_PAYMENT_ID`),
  KEY `PAYMENT_APP_GEO` (`TAX_AUTH_GEO_ID`),
  KEY `PAYMENT_APP_ORGLA` (`OVERRIDE_GL_ACCOUNT_ID`),
  KEY `PMNT_APPLCN_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `PMNT_APPLCN_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `PAYMENT_APP_BACT` FOREIGN KEY (`BILLING_ACCOUNT_ID`) REFERENCES `BILLING_ACCOUNT` (`BILLING_ACCOUNT_ID`),
  CONSTRAINT `PAYMENT_APP_GEO` FOREIGN KEY (`TAX_AUTH_GEO_ID`) REFERENCES `GEO` (`GEO_ID`),
  CONSTRAINT `PAYMENT_APP_INV` FOREIGN KEY (`INVOICE_ID`) REFERENCES `INVOICE` (`INVOICE_ID`),
  CONSTRAINT `PAYMENT_APP_ORGLA` FOREIGN KEY (`OVERRIDE_GL_ACCOUNT_ID`) REFERENCES `GL_ACCOUNT` (`GL_ACCOUNT_ID`),
  CONSTRAINT `PAYMENT_APP_PMT` FOREIGN KEY (`PAYMENT_ID`) REFERENCES `PAYMENT` (`PAYMENT_ID`),
  CONSTRAINT `PAYMENT_APP_TPMT` FOREIGN KEY (`TO_PAYMENT_ID`) REFERENCES `PAYMENT` (`PAYMENT_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PAYMENT_ATTRIBUTE`
--

DROP TABLE IF EXISTS `PAYMENT_ATTRIBUTE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PAYMENT_ATTRIBUTE` (
  `PAYMENT_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 (`PAYMENT_ID`,`ATTR_NAME`),
  KEY `PAYMENT_ATTR` (`PAYMENT_ID`),
  KEY `PMNT_ATTRBT_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `PMNT_ATTRBT_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `PAYMENT_ATTR` FOREIGN KEY (`PAYMENT_ID`) REFERENCES `PAYMENT` (`PAYMENT_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PAYMENT_BUDGET_ALLOCATION`
--

DROP TABLE IF EXISTS `PAYMENT_BUDGET_ALLOCATION`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PAYMENT_BUDGET_ALLOCATION` (
  `BUDGET_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `BUDGET_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PAYMENT_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 (`BUDGET_ID`,`BUDGET_ITEM_SEQ_ID`,`PAYMENT_ID`),
  KEY `PAYMENT_BA_BDGT` (`BUDGET_ID`),
  KEY `PAYMENT_BA_PMT` (`PAYMENT_ID`),
  KEY `PMT_BDT_ALLN_TXSTP` (`LAST_UPDATED_TX_STAMP`),
  KEY `PMT_BDT_ALLN_TXCRS` (`CREATED_TX_STAMP`),
  CONSTRAINT `PAYMENT_BA_BDGT` FOREIGN KEY (`BUDGET_ID`) REFERENCES `BUDGET` (`BUDGET_ID`),
  CONSTRAINT `PAYMENT_BA_PMT` FOREIGN KEY (`PAYMENT_ID`) REFERENCES `PAYMENT` (`PAYMENT_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PAYMENT_GATEWAYI_D_E_A_L`
--

DROP TABLE IF EXISTS `PAYMENT_GATEWAYI_D_E_A_L`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PAYMENT_GATEWAYI_D_E_A_L` (
  `PAYMENT_GATEWAY_CONFIG_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `MERCHANT_ID` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `MERCHANT_SUB_ID` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `MERCHANT_RETURN_U_R_L` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `ACQUIRER_U_R_L` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `ACQUIRER_TIMEOUT` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `PRIVATE_CERT` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `ACQUIRER_KEY_STORE_FILENAME` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `ACQUIRER_KEY_STORE_PASSWORD` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `MERCHANT_KEY_STORE_FILENAME` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `MERCHANT_KEY_STORE_PASSWORD` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `EXPIRATION_PERIOD` 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 (`PAYMENT_GATEWAY_CONFIG_ID`),
  KEY `PGID_PGC` (`PAYMENT_GATEWAY_CONFIG_ID`),
  KEY `PMT_GTW_D_E_A_L_TP` (`LAST_UPDATED_TX_STAMP`),
  KEY `PMT_GTW_D_E_A_L_TS` (`CREATED_TX_STAMP`),
  CONSTRAINT `PGID_PGC` FOREIGN KEY (`PAYMENT_GATEWAY_CONFIG_ID`) REFERENCES `PAYMENT_GATEWAY_CONFIG` (`PAYMENT_GATEWAY_CONFIG_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PAYMENT_GATEWAY_AUTHORIZE_NET`
--

DROP TABLE IF EXISTS `PAYMENT_GATEWAY_AUTHORIZE_NET`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PAYMENT_GATEWAY_AUTHORIZE_NET` (
  `PAYMENT_GATEWAY_CONFIG_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `TRANSACTION_URL` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `CERTIFICATE_ALIAS` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `API_VERSION` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `DELIMITED_DATA` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `DELIMITER_CHAR` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `CP_VERSION` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `CP_MARKET_TYPE` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `CP_DEVICE_TYPE` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `METHOD` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `EMAIL_CUSTOMER` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `EMAIL_MERCHANT` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `TEST_MODE` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `RELAY_RESPONSE` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `TRAN_KEY` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `USER_ID` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `PWD` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `TRANS_DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `DUPLICATE_WINDOW` 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 (`PAYMENT_GATEWAY_CONFIG_ID`),
  KEY `PGAN_PGC` (`PAYMENT_GATEWAY_CONFIG_ID`),
  KEY `PMT_GTW_ATZ_NT_TXP` (`LAST_UPDATED_TX_STAMP`),
  KEY `PMT_GTW_ATZ_NT_TXS` (`CREATED_TX_STAMP`),
  CONSTRAINT `PGAN_PGC` FOREIGN KEY (`PAYMENT_GATEWAY_CONFIG_ID`) REFERENCES `PAYMENT_GATEWAY_CONFIG` (`PAYMENT_GATEWAY_CONFIG_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PAYMENT_GATEWAY_CLEAR_COMMERCE`
--

DROP TABLE IF EXISTS `PAYMENT_GATEWAY_CLEAR_COMMERCE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PAYMENT_GATEWAY_CLEAR_COMMERCE` (
  `PAYMENT_GATEWAY_CONFIG_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `SOURCE_ID` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `GROUP_ID` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `CLIENT_ID` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `USERNAME` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `PWD` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `USER_ALIAS` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `EFFECTIVE_ALIAS` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `PROCESS_MODE` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `SERVER_U_R_L` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `ENABLE_C_V_M` 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 (`PAYMENT_GATEWAY_CONFIG_ID`),
  KEY `PGCC_PGC` (`PAYMENT_GATEWAY_CONFIG_ID`),
  KEY `PMT_GTW_CLR_CMC_TP` (`LAST_UPDATED_TX_STAMP`),
  KEY `PMT_GTW_CLR_CMC_TS` (`CREATED_TX_STAMP`),
  CONSTRAINT `PGCC_PGC` FOREIGN KEY (`PAYMENT_GATEWAY_CONFIG_ID`) REFERENCES `PAYMENT_GATEWAY_CONFIG` (`PAYMENT_GATEWAY_CONFIG_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PAYMENT_GATEWAY_CONFIG`
--

DROP TABLE IF EXISTS `PAYMENT_GATEWAY_CONFIG`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PAYMENT_GATEWAY_CONFIG` (
  `PAYMENT_GATEWAY_CONFIG_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PAYMENT_GATEWAY_CONFIG_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 (`PAYMENT_GATEWAY_CONFIG_ID`),
  KEY `PGC_PGCT` (`PAYMENT_GATEWAY_CONFIG_TYPE_ID`),
  KEY `PMT_GTW_CNG_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `PMT_GTW_CNG_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `PGC_PGCT` FOREIGN KEY (`PAYMENT_GATEWAY_CONFIG_TYPE_ID`) REFERENCES `PAYMENT_GATEWAY_CONFIG_TYPE` (`PAYMENT_GATEWAY_CONFIG_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PAYMENT_GATEWAY_CONFIG_TYPE`
--

DROP TABLE IF EXISTS `PAYMENT_GATEWAY_CONFIG_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PAYMENT_GATEWAY_CONFIG_TYPE` (
  `PAYMENT_GATEWAY_CONFIG_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 (`PAYMENT_GATEWAY_CONFIG_TYPE_ID`),
  KEY `PGCT_PAR` (`PARENT_TYPE_ID`),
  KEY `PMT_GTW_CNG_TP_TXP` (`LAST_UPDATED_TX_STAMP`),
  KEY `PMT_GTW_CNG_TP_TXS` (`CREATED_TX_STAMP`),
  CONSTRAINT `PGCT_PAR` FOREIGN KEY (`PARENT_TYPE_ID`) REFERENCES `PAYMENT_GATEWAY_CONFIG_TYPE` (`PAYMENT_GATEWAY_CONFIG_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PAYMENT_GATEWAY_CYBER_SOURCE`
--

DROP TABLE IF EXISTS `PAYMENT_GATEWAY_CYBER_SOURCE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PAYMENT_GATEWAY_CYBER_SOURCE` (
  `PAYMENT_GATEWAY_CONFIG_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `MERCHANT_ID` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `API_VERSION` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `PRODUCTION` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `KEYS_DIR` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `KEYS_FILE` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LOG_ENABLED` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `LOG_DIR` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LOG_FILE` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LOG_SIZE` decimal(20,0) DEFAULT NULL,
  `MERCHANT_DESCR` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `MERCHANT_CONTACT` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `AUTO_BILL` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `ENABLE_DAV` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `FRAUD_SCORE` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `IGNORE_AVS` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `DISABLE_BILL_AVS` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `AVS_DECLINE_CODES` 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 (`PAYMENT_GATEWAY_CONFIG_ID`),
  KEY `PGCS_PGC` (`PAYMENT_GATEWAY_CONFIG_ID`),
  KEY `PMT_GTW_CBR_SRC_TP` (`LAST_UPDATED_TX_STAMP`),
  KEY `PMT_GTW_CBR_SRC_TS` (`CREATED_TX_STAMP`),
  CONSTRAINT `PGCS_PGC` FOREIGN KEY (`PAYMENT_GATEWAY_CONFIG_ID`) REFERENCES `PAYMENT_GATEWAY_CONFIG` (`PAYMENT_GATEWAY_CONFIG_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PAYMENT_GATEWAY_EWAY`
--

DROP TABLE IF EXISTS `PAYMENT_GATEWAY_EWAY`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PAYMENT_GATEWAY_EWAY` (
  `PAYMENT_GATEWAY_CONFIG_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CUSTOMER_ID` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `REFUND_PWD` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `TEST_MODE` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `ENABLE_CVN` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `ENABLE_BEAGLE` 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 (`PAYMENT_GATEWAY_CONFIG_ID`),
  KEY `PGEW_PGC` (`PAYMENT_GATEWAY_CONFIG_ID`),
  KEY `PMNT_GTW_EW_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `PMNT_GTW_EW_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `PGEW_PGC` FOREIGN KEY (`PAYMENT_GATEWAY_CONFIG_ID`) REFERENCES `PAYMENT_GATEWAY_CONFIG` (`PAYMENT_GATEWAY_CONFIG_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PAYMENT_GATEWAY_ORBITAL`
--

DROP TABLE IF EXISTS `PAYMENT_GATEWAY_ORBITAL`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PAYMENT_GATEWAY_ORBITAL` (
  `PAYMENT_GATEWAY_CONFIG_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `USERNAME` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `CONNECTION_PASSWORD` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `MERCHANT_ID` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `ENGINE_CLASS` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `HOST_NAME` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `PORT` decimal(20,0) DEFAULT NULL,
  `HOST_NAME_FAILOVER` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `PORT_FAILOVER` decimal(20,0) DEFAULT NULL,
  `CONNECTION_TIMEOUT_SECONDS` decimal(20,0) DEFAULT NULL,
  `READ_TIMEOUT_SECONDS` decimal(20,0) DEFAULT NULL,
  `AUTHORIZATION_U_R_I` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `SDK_VERSION` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `SSL_SOCKET_FACTORY` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `RESPONSE_TYPE` 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 (`PAYMENT_GATEWAY_CONFIG_ID`),
  KEY `PGORB_PGC` (`PAYMENT_GATEWAY_CONFIG_ID`),
  KEY `PMT_GTW_ORBL_TXSTP` (`LAST_UPDATED_TX_STAMP`),
  KEY `PMT_GTW_ORBL_TXCRS` (`CREATED_TX_STAMP`),
  CONSTRAINT `PGORB_PGC` FOREIGN KEY (`PAYMENT_GATEWAY_CONFIG_ID`) REFERENCES `PAYMENT_GATEWAY_CONFIG` (`PAYMENT_GATEWAY_CONFIG_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PAYMENT_GATEWAY_PAYFLOW_PRO`
--

DROP TABLE IF EXISTS `PAYMENT_GATEWAY_PAYFLOW_PRO`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PAYMENT_GATEWAY_PAYFLOW_PRO` (
  `PAYMENT_GATEWAY_CONFIG_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CERTS_PATH` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `HOST_ADDRESS` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `HOST_PORT` decimal(20,0) DEFAULT NULL,
  `TIMEOUT` decimal(20,0) DEFAULT NULL,
  `PROXY_ADDRESS` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `PROXY_PORT` decimal(20,0) DEFAULT NULL,
  `PROXY_LOGON` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `PROXY_PASSWORD` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `VENDOR` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `USER_ID` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `PWD` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `PARTNER` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `CHECK_AVS` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `CHECK_CVV2` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `PRE_AUTH` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `ENABLE_TRANSMIT` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LOG_FILE_NAME` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LOGGING_LEVEL` decimal(20,0) DEFAULT NULL,
  `MAX_LOG_FILE_SIZE` decimal(20,0) DEFAULT NULL,
  `STACK_TRACE_ON` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `REDIRECT_URL` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `RETURN_URL` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `CANCEL_RETURN_URL` 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 (`PAYMENT_GATEWAY_CONFIG_ID`),
  KEY `PGPF_PGC` (`PAYMENT_GATEWAY_CONFIG_ID`),
  KEY `PMT_GTW_PFW_PR_TXP` (`LAST_UPDATED_TX_STAMP`),
  KEY `PMT_GTW_PFW_PR_TXS` (`CREATED_TX_STAMP`),
  CONSTRAINT `PGPF_PGC` FOREIGN KEY (`PAYMENT_GATEWAY_CONFIG_ID`) REFERENCES `PAYMENT_GATEWAY_CONFIG` (`PAYMENT_GATEWAY_CONFIG_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PAYMENT_GATEWAY_PAY_PAL`
--

DROP TABLE IF EXISTS `PAYMENT_GATEWAY_PAY_PAL`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PAYMENT_GATEWAY_PAY_PAL` (
  `PAYMENT_GATEWAY_CONFIG_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `BUSINESS_EMAIL` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `API_USER_NAME` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `API_PASSWORD` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `API_SIGNATURE` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `API_ENVIRONMENT` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `NOTIFY_URL` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `RETURN_URL` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `CANCEL_RETURN_URL` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `IMAGE_URL` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `CONFIRM_TEMPLATE` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `REDIRECT_URL` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `CONFIRM_URL` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `SHIPPING_CALLBACK_URL` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `REQUIRE_CONFIRMED_SHIPPING` 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 (`PAYMENT_GATEWAY_CONFIG_ID`),
  KEY `PGPP_PGC` (`PAYMENT_GATEWAY_CONFIG_ID`),
  KEY `PMT_GTW_P_PL_TXSTP` (`LAST_UPDATED_TX_STAMP`),
  KEY `PMT_GTW_P_PL_TXCRS` (`CREATED_TX_STAMP`),
  CONSTRAINT `PGPP_PGC` FOREIGN KEY (`PAYMENT_GATEWAY_CONFIG_ID`) REFERENCES `PAYMENT_GATEWAY_CONFIG` (`PAYMENT_GATEWAY_CONFIG_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PAYMENT_GATEWAY_RESPONSE`
--

DROP TABLE IF EXISTS `PAYMENT_GATEWAY_RESPONSE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PAYMENT_GATEWAY_RESPONSE` (
  `PAYMENT_GATEWAY_RESPONSE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PAYMENT_SERVICE_TYPE_ENUM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ORDER_PAYMENT_PREFERENCE_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,
  `TRANS_CODE_ENUM_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,
  `REFERENCE_NUM` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `ALT_REFERENCE` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `SUB_REFERENCE` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `GATEWAY_CODE` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `GATEWAY_FLAG` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `GATEWAY_AVS_RESULT` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `GATEWAY_CV_RESULT` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `GATEWAY_SCORE_RESULT` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `GATEWAY_MESSAGE` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `TRANSACTION_DATE` datetime DEFAULT NULL,
  `RESULT_DECLINED` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `RESULT_NSF` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `RESULT_BAD_EXPIRE` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `RESULT_BAD_CARD_NUMBER` 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 (`PAYMENT_GATEWAY_RESPONSE_ID`),
  KEY `PAYGATR_PSTENUM` (`PAYMENT_SERVICE_TYPE_ENUM_ID`),
  KEY `PAYGATR_TXCODE` (`TRANS_CODE_ENUM_ID`),
  KEY `PAYGATR_CUOM` (`CURRENCY_UOM_ID`),
  KEY `PAYGATR_ORDPMPRF` (`ORDER_PAYMENT_PREFERENCE_ID`),
  KEY `PAYGATR_PMTP` (`PAYMENT_METHOD_TYPE_ID`),
  KEY `PAYGATR_PMETH` (`PAYMENT_METHOD_ID`),
  KEY `PMT_GTW_RSPS_TXSTP` (`LAST_UPDATED_TX_STAMP`),
  KEY `PMT_GTW_RSPS_TXCRS` (`CREATED_TX_STAMP`),
  CONSTRAINT `PAYGATR_CUOM` FOREIGN KEY (`CURRENCY_UOM_ID`) REFERENCES `UOM` (`UOM_ID`),
  CONSTRAINT `PAYGATR_ORDPMPRF` FOREIGN KEY (`ORDER_PAYMENT_PREFERENCE_ID`) REFERENCES `ORDER_PAYMENT_PREFERENCE` (`ORDER_PAYMENT_PREFERENCE_ID`),
  CONSTRAINT `PAYGATR_PMETH` FOREIGN KEY (`PAYMENT_METHOD_ID`) REFERENCES `PAYMENT_METHOD` (`PAYMENT_METHOD_ID`),
  CONSTRAINT `PAYGATR_PMTP` FOREIGN KEY (`PAYMENT_METHOD_TYPE_ID`) REFERENCES `PAYMENT_METHOD_TYPE` (`PAYMENT_METHOD_TYPE_ID`),
  CONSTRAINT `PAYGATR_PSTENUM` FOREIGN KEY (`PAYMENT_SERVICE_TYPE_ENUM_ID`) REFERENCES `ENUMERATION` (`ENUM_ID`),
  CONSTRAINT `PAYGATR_TXCODE` FOREIGN KEY (`TRANS_CODE_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 `PAYMENT_GATEWAY_RESP_MSG`
--

DROP TABLE IF EXISTS `PAYMENT_GATEWAY_RESP_MSG`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PAYMENT_GATEWAY_RESP_MSG` (
  `PAYMENT_GATEWAY_RESP_MSG_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PAYMENT_GATEWAY_RESPONSE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PGR_MESSAGE` 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 (`PAYMENT_GATEWAY_RESP_MSG_ID`),
  KEY `PAYGATRM_PAYGR` (`PAYMENT_GATEWAY_RESPONSE_ID`),
  KEY `PMT_GTW_RSP_MSG_TP` (`LAST_UPDATED_TX_STAMP`),
  KEY `PMT_GTW_RSP_MSG_TS` (`CREATED_TX_STAMP`),
  CONSTRAINT `PAYGATRM_PAYGR` FOREIGN KEY (`PAYMENT_GATEWAY_RESPONSE_ID`) REFERENCES `PAYMENT_GATEWAY_RESPONSE` (`PAYMENT_GATEWAY_RESPONSE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PAYMENT_GATEWAY_SAGE_PAY`
--

DROP TABLE IF EXISTS `PAYMENT_GATEWAY_SAGE_PAY`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PAYMENT_GATEWAY_SAGE_PAY` (
  `PAYMENT_GATEWAY_CONFIG_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `VENDOR` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `PRODUCTION_HOST` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `TESTING_HOST` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `SAGE_PAY_MODE` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `PROTOCOL_VERSION` varchar(10) COLLATE latin1_general_cs DEFAULT NULL,
  `AUTHENTICATION_TRANS_TYPE` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `AUTHENTICATION_URL` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `AUTHORISE_TRANS_TYPE` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `AUTHORISE_URL` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `RELEASE_TRANS_TYPE` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `RELEASE_URL` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `VOID_URL` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `REFUND_URL` 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 (`PAYMENT_GATEWAY_CONFIG_ID`),
  KEY `PGSP_PGC` (`PAYMENT_GATEWAY_CONFIG_ID`),
  KEY `PMT_GTW_SG_P_TXSTP` (`LAST_UPDATED_TX_STAMP`),
  KEY `PMT_GTW_SG_P_TXCRS` (`CREATED_TX_STAMP`),
  CONSTRAINT `PGSP_PGC` FOREIGN KEY (`PAYMENT_GATEWAY_CONFIG_ID`) REFERENCES `PAYMENT_GATEWAY_CONFIG` (`PAYMENT_GATEWAY_CONFIG_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PAYMENT_GATEWAY_SECURE_PAY`
--

DROP TABLE IF EXISTS `PAYMENT_GATEWAY_SECURE_PAY`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PAYMENT_GATEWAY_SECURE_PAY` (
  `PAYMENT_GATEWAY_CONFIG_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `MERCHANT_ID` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `PWD` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `SERVER_U_R_L` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `PROCESS_TIMEOUT` decimal(20,0) DEFAULT NULL,
  `ENABLE_AMOUNT_ROUND` 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 (`PAYMENT_GATEWAY_CONFIG_ID`),
  KEY `PGSCP_PGC` (`PAYMENT_GATEWAY_CONFIG_ID`),
  KEY `PMT_GTW_SCR_P_TXSP` (`LAST_UPDATED_TX_STAMP`),
  KEY `PMT_GTW_SCR_P_TXCS` (`CREATED_TX_STAMP`),
  CONSTRAINT `PGSCP_PGC` FOREIGN KEY (`PAYMENT_GATEWAY_CONFIG_ID`) REFERENCES `PAYMENT_GATEWAY_CONFIG` (`PAYMENT_GATEWAY_CONFIG_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PAYMENT_GATEWAY_WORLD_PAY`
--

DROP TABLE IF EXISTS `PAYMENT_GATEWAY_WORLD_PAY`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PAYMENT_GATEWAY_WORLD_PAY` (
  `PAYMENT_GATEWAY_CONFIG_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `REDIRECT_URL` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `INST_ID` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `AUTH_MODE` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `FIX_CONTACT` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `HIDE_CONTACT` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `HIDE_CURRENCY` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `LANG_ID` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `NO_LANGUAGE_MENU` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `WITH_DELIVERY` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `TEST_MODE` 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 (`PAYMENT_GATEWAY_CONFIG_ID`),
  KEY `PGWP_PGC` (`PAYMENT_GATEWAY_CONFIG_ID`),
  KEY `PMT_GTW_WRD_P_TXSP` (`LAST_UPDATED_TX_STAMP`),
  KEY `PMT_GTW_WRD_P_TXCS` (`CREATED_TX_STAMP`),
  CONSTRAINT `PGWP_PGC` FOREIGN KEY (`PAYMENT_GATEWAY_CONFIG_ID`) REFERENCES `PAYMENT_GATEWAY_CONFIG` (`PAYMENT_GATEWAY_CONFIG_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PAYMENT_GL_ACCOUNT_TYPE_MAP`
--

DROP TABLE IF EXISTS `PAYMENT_GL_ACCOUNT_TYPE_MAP`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PAYMENT_GL_ACCOUNT_TYPE_MAP` (
  `PAYMENT_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ORGANIZATION_PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `GL_ACCOUNT_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 (`PAYMENT_TYPE_ID`,`ORGANIZATION_PARTY_ID`),
  KEY `PMTGLACCT_PMTTYPE` (`PAYMENT_TYPE_ID`),
  KEY `PMTGLACCT_PARTY` (`ORGANIZATION_PARTY_ID`),
  KEY `PMTGLACCT_GLACCT` (`GL_ACCOUNT_TYPE_ID`),
  KEY `PMT_ACT_TP_MP_TP` (`LAST_UPDATED_TX_STAMP`),
  KEY `PMT_ACT_TP_MP_TS` (`CREATED_TX_STAMP`),
  CONSTRAINT `PMTGLACCT_GLACCT` FOREIGN KEY (`GL_ACCOUNT_TYPE_ID`) REFERENCES `GL_ACCOUNT_TYPE` (`GL_ACCOUNT_TYPE_ID`),
  CONSTRAINT `PMTGLACCT_PARTY` FOREIGN KEY (`ORGANIZATION_PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `PMTGLACCT_PMTTYPE` FOREIGN KEY (`PAYMENT_TYPE_ID`) REFERENCES `PAYMENT_TYPE` (`PAYMENT_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PAYMENT_GROUP`
--

DROP TABLE IF EXISTS `PAYMENT_GROUP`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PAYMENT_GROUP` (
  `PAYMENT_GROUP_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PAYMENT_GROUP_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PAYMENT_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 (`PAYMENT_GROUP_ID`),
  KEY `PAYMNTGP_PGTYPE` (`PAYMENT_GROUP_TYPE_ID`),
  KEY `PMNT_GRP_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `PMNT_GRP_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `PAYMNTGP_PGTYPE` FOREIGN KEY (`PAYMENT_GROUP_TYPE_ID`) REFERENCES `PAYMENT_GROUP_TYPE` (`PAYMENT_GROUP_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PAYMENT_GROUP_MEMBER`
--

DROP TABLE IF EXISTS `PAYMENT_GROUP_MEMBER`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PAYMENT_GROUP_MEMBER` (
  `PAYMENT_GROUP_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PAYMENT_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 (`PAYMENT_GROUP_ID`,`PAYMENT_ID`,`FROM_DATE`),
  KEY `PAYGRPMMBR_PG` (`PAYMENT_GROUP_ID`),
  KEY `PAYGRPMMBR_PAYMNT` (`PAYMENT_ID`),
  KEY `PMT_GRP_MMR_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `PMT_GRP_MMR_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `PAYGRPMMBR_PAYMNT` FOREIGN KEY (`PAYMENT_ID`) REFERENCES `PAYMENT` (`PAYMENT_ID`),
  CONSTRAINT `PAYGRPMMBR_PG` FOREIGN KEY (`PAYMENT_GROUP_ID`) REFERENCES `PAYMENT_GROUP` (`PAYMENT_GROUP_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PAYMENT_GROUP_TYPE`
--

DROP TABLE IF EXISTS `PAYMENT_GROUP_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PAYMENT_GROUP_TYPE` (
  `PAYMENT_GROUP_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 (`PAYMENT_GROUP_TYPE_ID`),
  KEY `PAYMNTGP_TYP_PAR` (`PARENT_TYPE_ID`),
  CONSTRAINT `PAYMNTGP_TYP_PAR` FOREIGN KEY (`PARENT_TYPE_ID`) REFERENCES `PAYMENT_GROUP_TYPE` (`PAYMENT_GROUP_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PAYMENT_METHOD`
--

DROP TABLE IF EXISTS `PAYMENT_METHOD`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PAYMENT_METHOD` (
  `PAYMENT_METHOD_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PAYMENT_METHOD_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `GL_ACCOUNT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `FIN_ACCOUNT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `DESCRIPTION` varchar(255) 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 (`PAYMENT_METHOD_ID`),
  KEY `PAYMETH_TYPE` (`PAYMENT_METHOD_TYPE_ID`),
  KEY `PAYMETH_PARTY` (`PARTY_ID`),
  KEY `PAYMETH_GLACCT` (`GL_ACCOUNT_ID`),
  KEY `PAYMETH_FINACCT` (`FIN_ACCOUNT_ID`),
  CONSTRAINT `PAYMETH_FINACCT` FOREIGN KEY (`FIN_ACCOUNT_ID`) REFERENCES `FIN_ACCOUNT` (`FIN_ACCOUNT_ID`),
  CONSTRAINT `PAYMETH_GLACCT` FOREIGN KEY (`GL_ACCOUNT_ID`) REFERENCES `GL_ACCOUNT` (`GL_ACCOUNT_ID`),
  CONSTRAINT `PAYMETH_PARTY` FOREIGN KEY (`PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `PAYMETH_TYPE` FOREIGN KEY (`PAYMENT_METHOD_TYPE_ID`) REFERENCES `PAYMENT_METHOD_TYPE` (`PAYMENT_METHOD_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PAYMENT_METHOD_TYPE`
--

DROP TABLE IF EXISTS `PAYMENT_METHOD_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PAYMENT_METHOD_TYPE` (
  `PAYMENT_METHOD_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT 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 (`PAYMENT_METHOD_TYPE_ID`),
  KEY `PAYMENT_MTP_DGLAC` (`DEFAULT_GL_ACCOUNT_ID`),
  CONSTRAINT `PAYMENT_MTP_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 `PAYMENT_METHOD_TYPE_GL_ACCOUNT`
--

DROP TABLE IF EXISTS `PAYMENT_METHOD_TYPE_GL_ACCOUNT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PAYMENT_METHOD_TYPE_GL_ACCOUNT` (
  `PAYMENT_METHOD_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 (`PAYMENT_METHOD_TYPE_ID`,`ORGANIZATION_PARTY_ID`),
  KEY `PAYMENT_MTGA_PMT` (`PAYMENT_METHOD_TYPE_ID`),
  KEY `PAYMENT_MTGA_OPTY` (`ORGANIZATION_PARTY_ID`),
  KEY `PAYMENT_MTGA_GLAC` (`GL_ACCOUNT_ID`),
  CONSTRAINT `PAYMENT_MTGA_GLAC` FOREIGN KEY (`GL_ACCOUNT_ID`) REFERENCES `GL_ACCOUNT` (`GL_ACCOUNT_ID`),
  CONSTRAINT `PAYMENT_MTGA_OPTY` FOREIGN KEY (`ORGANIZATION_PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `PAYMENT_MTGA_PMT` FOREIGN KEY (`PAYMENT_METHOD_TYPE_ID`) REFERENCES `PAYMENT_METHOD_TYPE` (`PAYMENT_METHOD_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PAYMENT_TYPE`
--

DROP TABLE IF EXISTS `PAYMENT_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PAYMENT_TYPE` (
  `PAYMENT_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 (`PAYMENT_TYPE_ID`),
  KEY `PAYMENT_TYPE_PAR` (`PARENT_TYPE_ID`),
  CONSTRAINT `PAYMENT_TYPE_PAR` FOREIGN KEY (`PARENT_TYPE_ID`) REFERENCES `PAYMENT_TYPE` (`PAYMENT_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PAYMENT_TYPE_ATTR`
--

DROP TABLE IF EXISTS `PAYMENT_TYPE_ATTR`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PAYMENT_TYPE_ATTR` (
  `PAYMENT_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 (`PAYMENT_TYPE_ID`,`ATTR_NAME`),
  KEY `PAYMETH_TYPE_ATTR` (`PAYMENT_TYPE_ID`),
  CONSTRAINT `PAYMETH_TYPE_ATTR` FOREIGN KEY (`PAYMENT_TYPE_ID`) REFERENCES `PAYMENT_TYPE` (`PAYMENT_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PAYROLL_PREFERENCE`
--

DROP TABLE IF EXISTS `PAYROLL_PREFERENCE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PAYROLL_PREFERENCE` (
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ROLE_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PAYROLL_PREFERENCE_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `DEDUCTION_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PAYMENT_METHOD_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PERIOD_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `FROM_DATE` datetime DEFAULT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `PERCENTAGE` double DEFAULT NULL,
  `FLAT_AMOUNT` decimal(18,2) DEFAULT NULL,
  `ROUTING_NUMBER` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `ACCOUNT_NUMBER` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `BANK_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 (`PARTY_ID`,`ROLE_TYPE_ID`,`PAYROLL_PREFERENCE_SEQ_ID`),
  KEY `PRL_PREF_PRTY` (`PARTY_ID`),
  KEY `PRL_PREF_PTRL` (`PARTY_ID`,`ROLE_TYPE_ID`),
  CONSTRAINT `PRL_PREF_PRTY` FOREIGN KEY (`PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `PRL_PREF_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 `PAY_GRADE`
--

DROP TABLE IF EXISTS `PAY_GRADE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PAY_GRADE` (
  `PAY_GRADE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PAY_GRADE_NAME` varchar(100) 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 (`PAY_GRADE_ID`),
  KEY `PAY_GRADE_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `PAY_GRADE_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 `PAY_HISTORY`
--

DROP TABLE IF EXISTS `PAY_HISTORY`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PAY_HISTORY` (
  `ROLE_TYPE_ID_FROM` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ROLE_TYPE_ID_TO` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARTY_ID_FROM` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARTY_ID_TO` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FROM_DATE` datetime NOT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `SALARY_STEP_SEQ_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PAY_GRADE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PERIOD_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `AMOUNT` decimal(18,2) 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 (`ROLE_TYPE_ID_FROM`,`ROLE_TYPE_ID_TO`,`PARTY_ID_FROM`,`PARTY_ID_TO`,`FROM_DATE`),
  KEY `PAY_HIST_EMPLMNT` (`ROLE_TYPE_ID_FROM`,`ROLE_TYPE_ID_TO`,`PARTY_ID_FROM`,`PARTY_ID_TO`,`FROM_DATE`),
  KEY `PAY_HIST_PGRD` (`PAY_GRADE_ID`),
  KEY `PAY_HIST_PDTP` (`PERIOD_TYPE_ID`),
  KEY `PAY_HISTORY_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `PAY_HISTORY_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `PAY_HIST_EMPLMNT` FOREIGN KEY (`ROLE_TYPE_ID_FROM`, `ROLE_TYPE_ID_TO`, `PARTY_ID_FROM`, `PARTY_ID_TO`, `FROM_DATE`) REFERENCES `EMPLOYMENT` (`ROLE_TYPE_ID_FROM`, `ROLE_TYPE_ID_TO`, `PARTY_ID_FROM`, `PARTY_ID_TO`, `FROM_DATE`),
  CONSTRAINT `PAY_HIST_PDTP` FOREIGN KEY (`PERIOD_TYPE_ID`) REFERENCES `PERIOD_TYPE` (`PERIOD_TYPE_ID`),
  CONSTRAINT `PAY_HIST_PGRD` FOREIGN KEY (`PAY_GRADE_ID`) REFERENCES `PAY_GRADE` (`PAY_GRADE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PAY_PAL_PAYMENT_METHOD`
--

DROP TABLE IF EXISTS `PAY_PAL_PAYMENT_METHOD`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PAY_PAL_PAYMENT_METHOD` (
  `PAYMENT_METHOD_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PAYER_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `EXPRESS_CHECKOUT_TOKEN` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `PAYER_STATUS` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `AVS_ADDR` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `AVS_ZIP` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `CORRELATION_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `CONTACT_MECH_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `TRANSACTION_ID` 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 (`PAYMENT_METHOD_ID`),
  KEY `PAYPAL_PMNTMETH` (`PAYMENT_METHOD_ID`),
  KEY `PAYPAL_CMECH` (`CONTACT_MECH_ID`),
  KEY `PAYPAL_PADDR` (`CONTACT_MECH_ID`),
  KEY `P_PL_PMT_MTD_TXSTP` (`LAST_UPDATED_TX_STAMP`),
  KEY `P_PL_PMT_MTD_TXCRS` (`CREATED_TX_STAMP`),
  CONSTRAINT `PAYPAL_CMECH` FOREIGN KEY (`CONTACT_MECH_ID`) REFERENCES `CONTACT_MECH` (`CONTACT_MECH_ID`),
  CONSTRAINT `PAYPAL_PADDR` FOREIGN KEY (`CONTACT_MECH_ID`) REFERENCES `POSTAL_ADDRESS` (`CONTACT_MECH_ID`),
  CONSTRAINT `PAYPAL_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 `PERFORMANCE_NOTE`
--

DROP TABLE IF EXISTS `PERFORMANCE_NOTE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PERFORMANCE_NOTE` (
  `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,
  `COMMUNICATION_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 (`PARTY_ID`,`ROLE_TYPE_ID`,`FROM_DATE`),
  KEY `PERF_NOTE_PRTY` (`PARTY_ID`),
  KEY `PERF_NOTE_PRLE` (`PARTY_ID`,`ROLE_TYPE_ID`),
  CONSTRAINT `PERF_NOTE_PRLE` FOREIGN KEY (`PARTY_ID`, `ROLE_TYPE_ID`) REFERENCES `PARTY_ROLE` (`PARTY_ID`, `ROLE_TYPE_ID`),
  CONSTRAINT `PERF_NOTE_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 `PERF_RATING_TYPE`
--

DROP TABLE IF EXISTS `PERF_RATING_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PERF_RATING_TYPE` (
  `PERF_RATING_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 (`PERF_RATING_TYPE_ID`),
  KEY `PERF_RATNG_TYP` (`PARENT_TYPE_ID`),
  CONSTRAINT `PERF_RATNG_TYP` FOREIGN KEY (`PARENT_TYPE_ID`) REFERENCES `PERF_RATING_TYPE` (`PERF_RATING_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PERF_REVIEW`
--

DROP TABLE IF EXISTS `PERF_REVIEW`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PERF_REVIEW` (
  `EMPLOYEE_PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `EMPLOYEE_ROLE_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PERF_REVIEW_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `MANAGER_PARTY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `MANAGER_ROLE_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PAYMENT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `EMPL_POSITION_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `FROM_DATE` datetime DEFAULT NULL,
  `THRU_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 (`EMPLOYEE_PARTY_ID`,`EMPLOYEE_ROLE_TYPE_ID`,`PERF_REVIEW_ID`),
  KEY `PERF_REV_EPTY` (`EMPLOYEE_PARTY_ID`),
  KEY `PERF_REV_EPTRL` (`EMPLOYEE_PARTY_ID`,`EMPLOYEE_ROLE_TYPE_ID`),
  KEY `PERF_REV_MPTY` (`MANAGER_PARTY_ID`),
  KEY `PERF_REV_PMNT` (`PAYMENT_ID`),
  CONSTRAINT `PERF_REV_EPTRL` FOREIGN KEY (`EMPLOYEE_PARTY_ID`, `EMPLOYEE_ROLE_TYPE_ID`) REFERENCES `PARTY_ROLE` (`PARTY_ID`, `ROLE_TYPE_ID`),
  CONSTRAINT `PERF_REV_EPTY` FOREIGN KEY (`EMPLOYEE_PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `PERF_REV_MPTY` FOREIGN KEY (`MANAGER_PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `PERF_REV_PMNT` FOREIGN KEY (`PAYMENT_ID`) REFERENCES `PAYMENT` (`PAYMENT_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PERF_REVIEW_ITEM`
--

DROP TABLE IF EXISTS `PERF_REVIEW_ITEM`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PERF_REVIEW_ITEM` (
  `EMPLOYEE_PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `EMPLOYEE_ROLE_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PERF_REVIEW_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PERF_REVIEW_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PERF_REVIEW_ITEM_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PERF_RATING_TYPE_ID` varchar(20) 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 (`EMPLOYEE_PARTY_ID`,`EMPLOYEE_ROLE_TYPE_ID`,`PERF_REVIEW_ID`,`PERF_REVIEW_ITEM_SEQ_ID`),
  KEY `PERF_RVITM_PFRV` (`EMPLOYEE_PARTY_ID`,`EMPLOYEE_ROLE_TYPE_ID`,`PERF_REVIEW_ID`),
  KEY `PERF_RVITM_EPTY` (`EMPLOYEE_PARTY_ID`),
  KEY `PERF_RVITM_EPTRL` (`EMPLOYEE_PARTY_ID`,`EMPLOYEE_ROLE_TYPE_ID`),
  CONSTRAINT `PERF_RVITM_EPTRL` FOREIGN KEY (`EMPLOYEE_PARTY_ID`, `EMPLOYEE_ROLE_TYPE_ID`) REFERENCES `PARTY_ROLE` (`PARTY_ID`, `ROLE_TYPE_ID`),
  CONSTRAINT `PERF_RVITM_EPTY` FOREIGN KEY (`EMPLOYEE_PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `PERF_RVITM_PFRV` FOREIGN KEY (`EMPLOYEE_PARTY_ID`, `EMPLOYEE_ROLE_TYPE_ID`, `PERF_REVIEW_ID`) REFERENCES `PERF_REVIEW` (`EMPLOYEE_PARTY_ID`, `EMPLOYEE_ROLE_TYPE_ID`, `PERF_REVIEW_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PERF_REVIEW_ITEM_TYPE`
--

DROP TABLE IF EXISTS `PERF_REVIEW_ITEM_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PERF_REVIEW_ITEM_TYPE` (
  `PERF_REVIEW_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 (`PERF_REVIEW_ITEM_TYPE_ID`),
  KEY `PERF_REV_ITM_TYP` (`PARENT_TYPE_ID`),
  CONSTRAINT `PERF_REV_ITM_TYP` FOREIGN KEY (`PARENT_TYPE_ID`) REFERENCES `PERF_REVIEW_ITEM_TYPE` (`PERF_REVIEW_ITEM_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PERIOD_TYPE`
--

DROP TABLE IF EXISTS `PERIOD_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PERIOD_TYPE` (
  `PERIOD_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `PERIOD_LENGTH` decimal(20,0) 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 (`PERIOD_TYPE_ID`),
  KEY `PER_TYPE_UOM` (`UOM_ID`),
  CONSTRAINT `PER_TYPE_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 `PERSON`
--

DROP TABLE IF EXISTS `PERSON`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PERSON` (
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `SALUTATION` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `FIRST_NAME` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `MIDDLE_NAME` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_NAME` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `PERSONAL_TITLE` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `SUFFIX` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `NICKNAME` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `FIRST_NAME_LOCAL` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `MIDDLE_NAME_LOCAL` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_NAME_LOCAL` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `OTHER_LOCAL` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `MEMBER_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `GENDER` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `BIRTH_DATE` date DEFAULT NULL,
  `DECEASED_DATE` date DEFAULT NULL,
  `HEIGHT` double DEFAULT NULL,
  `WEIGHT` double DEFAULT NULL,
  `MOTHERS_MAIDEN_NAME` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `MARITAL_STATUS` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `SOCIAL_SECURITY_NUMBER` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `PASSPORT_NUMBER` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `PASSPORT_EXPIRE_DATE` date DEFAULT NULL,
  `TOTAL_YEARS_WORK_EXPERIENCE` double DEFAULT NULL,
  `COMMENTS` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `EMPLOYMENT_STATUS_ENUM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `RESIDENCE_STATUS_ENUM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `OCCUPATION` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `YEARS_WITH_EMPLOYER` decimal(20,0) DEFAULT NULL,
  `MONTHS_WITH_EMPLOYER` decimal(20,0) DEFAULT NULL,
  `EXISTING_CUSTOMER` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `CARD_ID` 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 (`PARTY_ID`),
  KEY `PERSON_PARTY` (`PARTY_ID`),
  KEY `PERSON_EMPS_ENUM` (`EMPLOYMENT_STATUS_ENUM_ID`),
  KEY `PERSON_RESS_ENUM` (`RESIDENCE_STATUS_ENUM_ID`),
  CONSTRAINT `PERSON_EMPS_ENUM` FOREIGN KEY (`EMPLOYMENT_STATUS_ENUM_ID`) REFERENCES `ENUMERATION` (`ENUM_ID`),
  CONSTRAINT `PERSON_PARTY` FOREIGN KEY (`PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `PERSON_RESS_ENUM` FOREIGN KEY (`RESIDENCE_STATUS_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 `PERSON_TRAINING`
--

DROP TABLE IF EXISTS `PERSON_TRAINING`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PERSON_TRAINING` (
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `TRAINING_REQUEST_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `TRAINING_CLASS_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `WORK_EFFORT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `FROM_DATE` datetime NOT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `APPROVER_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `APPROVAL_STATUS` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `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 (`PARTY_ID`,`TRAINING_CLASS_TYPE_ID`,`FROM_DATE`),
  KEY `PERS_TRNG_PRTY` (`PARTY_ID`),
  KEY `PERS_TRNG_APPR` (`APPROVER_ID`),
  KEY `PERS_TRNG_TCTP` (`TRAINING_CLASS_TYPE_ID`),
  KEY `PERS_TRNG_WREF` (`WORK_EFFORT_ID`),
  KEY `PERS_TRNG_TRNRQ` (`TRAINING_REQUEST_ID`),
  CONSTRAINT `PERS_TRNG_APPR` FOREIGN KEY (`APPROVER_ID`) REFERENCES `PERSON` (`PARTY_ID`),
  CONSTRAINT `PERS_TRNG_PRTY` FOREIGN KEY (`PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `PERS_TRNG_TCTP` FOREIGN KEY (`TRAINING_CLASS_TYPE_ID`) REFERENCES `TRAINING_CLASS_TYPE` (`TRAINING_CLASS_TYPE_ID`),
  CONSTRAINT `PERS_TRNG_TRNRQ` FOREIGN KEY (`TRAINING_REQUEST_ID`) REFERENCES `TRAINING_REQUEST` (`TRAINING_REQUEST_ID`),
  CONSTRAINT `PERS_TRNG_WREF` 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 `PHYSICAL_INVENTORY`
--

DROP TABLE IF EXISTS `PHYSICAL_INVENTORY`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PHYSICAL_INVENTORY` (
  `PHYSICAL_INVENTORY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PHYSICAL_INVENTORY_DATE` datetime DEFAULT NULL,
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `GENERAL_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 (`PHYSICAL_INVENTORY_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PICKLIST`
--

DROP TABLE IF EXISTS `PICKLIST`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PICKLIST` (
  `PICKLIST_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `FACILITY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SHIPMENT_METHOD_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `STATUS_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PICKLIST_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 (`PICKLIST_ID`),
  KEY `PICKLST_FLTY` (`FACILITY_ID`),
  KEY `PICKLST_SMTP` (`SHIPMENT_METHOD_TYPE_ID`),
  KEY `PICKLST_STTS` (`STATUS_ID`),
  CONSTRAINT `PICKLST_FLTY` FOREIGN KEY (`FACILITY_ID`) REFERENCES `FACILITY` (`FACILITY_ID`),
  CONSTRAINT `PICKLST_SMTP` FOREIGN KEY (`SHIPMENT_METHOD_TYPE_ID`) REFERENCES `SHIPMENT_METHOD_TYPE` (`SHIPMENT_METHOD_TYPE_ID`),
  CONSTRAINT `PICKLST_STTS` 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 `PICKLIST_BIN`
--

DROP TABLE IF EXISTS `PICKLIST_BIN`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PICKLIST_BIN` (
  `PICKLIST_BIN_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PICKLIST_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `BIN_LOCATION_NUMBER` decimal(20,0) DEFAULT NULL,
  `PRIMARY_ORDER_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PRIMARY_SHIP_GROUP_SEQ_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 (`PICKLIST_BIN_ID`),
  KEY `PCKLST_BIN_PKLT` (`PICKLIST_ID`),
  KEY `PCKLST_BIN_OISG` (`PRIMARY_ORDER_ID`,`PRIMARY_SHIP_GROUP_SEQ_ID`),
  CONSTRAINT `PCKLST_BIN_OISG` FOREIGN KEY (`PRIMARY_ORDER_ID`, `PRIMARY_SHIP_GROUP_SEQ_ID`) REFERENCES `ORDER_ITEM_SHIP_GROUP` (`ORDER_ID`, `SHIP_GROUP_SEQ_ID`),
  CONSTRAINT `PCKLST_BIN_PKLT` FOREIGN KEY (`PICKLIST_ID`) REFERENCES `PICKLIST` (`PICKLIST_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PICKLIST_ITEM`
--

DROP TABLE IF EXISTS `PICKLIST_ITEM`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PICKLIST_ITEM` (
  `PICKLIST_BIN_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,
  `SHIP_GROUP_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `INVENTORY_ITEM_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ITEM_STATUS_ID` varchar(20) COLLATE latin1_general_cs DEFAULT 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 (`PICKLIST_BIN_ID`,`ORDER_ID`,`ORDER_ITEM_SEQ_ID`,`SHIP_GROUP_SEQ_ID`,`INVENTORY_ITEM_ID`),
  KEY `PCKLST_ITM_BIN` (`PICKLIST_BIN_ID`),
  KEY `PCKLST_ITM_OISG` (`ORDER_ID`,`SHIP_GROUP_SEQ_ID`),
  KEY `PCKLST_ITM_ODIT` (`ORDER_ID`,`ORDER_ITEM_SEQ_ID`),
  KEY `PICKLST_ITM_STTS` (`ITEM_STATUS_ID`),
  KEY `PCKLST_ITM_INV` (`INVENTORY_ITEM_ID`),
  CONSTRAINT `PCKLST_ITM_BIN` FOREIGN KEY (`PICKLIST_BIN_ID`) REFERENCES `PICKLIST_BIN` (`PICKLIST_BIN_ID`),
  CONSTRAINT `PCKLST_ITM_INV` FOREIGN KEY (`INVENTORY_ITEM_ID`) REFERENCES `INVENTORY_ITEM` (`INVENTORY_ITEM_ID`),
  CONSTRAINT `PCKLST_ITM_ODIT` FOREIGN KEY (`ORDER_ID`, `ORDER_ITEM_SEQ_ID`) REFERENCES `ORDER_ITEM` (`ORDER_ID`, `ORDER_ITEM_SEQ_ID`),
  CONSTRAINT `PCKLST_ITM_OISG` FOREIGN KEY (`ORDER_ID`, `SHIP_GROUP_SEQ_ID`) REFERENCES `ORDER_ITEM_SHIP_GROUP` (`ORDER_ID`, `SHIP_GROUP_SEQ_ID`),
  CONSTRAINT `PICKLST_ITM_STTS` FOREIGN KEY (`ITEM_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 `PICKLIST_ROLE`
--

DROP TABLE IF EXISTS `PICKLIST_ROLE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PICKLIST_ROLE` (
  `PICKLIST_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,
  `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 (`PICKLIST_ID`,`PARTY_ID`,`ROLE_TYPE_ID`,`FROM_DATE`),
  KEY `PCKLST_RLE_PKLT` (`PICKLIST_ID`),
  KEY `PCKLST_RLE_PRLE` (`PARTY_ID`,`ROLE_TYPE_ID`),
  KEY `PCKLST_RLE_CBUL` (`CREATED_BY_USER_LOGIN`),
  KEY `PCKLST_RLE_LMUL` (`LAST_MODIFIED_BY_USER_LOGIN`),
  CONSTRAINT `PCKLST_RLE_CBUL` FOREIGN KEY (`CREATED_BY_USER_LOGIN`) REFERENCES `USER_LOGIN` (`USER_LOGIN_ID`),
  CONSTRAINT `PCKLST_RLE_LMUL` FOREIGN KEY (`LAST_MODIFIED_BY_USER_LOGIN`) REFERENCES `USER_LOGIN` (`USER_LOGIN_ID`),
  CONSTRAINT `PCKLST_RLE_PKLT` FOREIGN KEY (`PICKLIST_ID`) REFERENCES `PICKLIST` (`PICKLIST_ID`),
  CONSTRAINT `PCKLST_RLE_PRLE` 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 `PICKLIST_STATUS_HISTORY`
--

DROP TABLE IF EXISTS `PICKLIST_STATUS_HISTORY`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PICKLIST_STATUS_HISTORY` (
  `PICKLIST_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CHANGE_DATE` datetime NOT NULL,
  `CHANGE_USER_LOGIN_ID` varchar(250) COLLATE latin1_general_cs DEFAULT NULL,
  `STATUS_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `STATUS_ID_TO` 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 (`PICKLIST_ID`,`CHANGE_DATE`),
  KEY `PCKLST_STHST_PKLT` (`PICKLIST_ID`),
  KEY `PCKLST_STHST_CUL` (`CHANGE_USER_LOGIN_ID`),
  KEY `PCKLST_STHST_FSI` (`STATUS_ID`),
  KEY `PCKLST_STHST_TSI` (`STATUS_ID_TO`),
  KEY `PCKLST_STHST_SVC` (`STATUS_ID`,`STATUS_ID_TO`),
  CONSTRAINT `PCKLST_STHST_CUL` FOREIGN KEY (`CHANGE_USER_LOGIN_ID`) REFERENCES `USER_LOGIN` (`USER_LOGIN_ID`),
  CONSTRAINT `PCKLST_STHST_FSI` FOREIGN KEY (`STATUS_ID`) REFERENCES `STATUS_ITEM` (`STATUS_ID`),
  CONSTRAINT `PCKLST_STHST_PKLT` FOREIGN KEY (`PICKLIST_ID`) REFERENCES `PICKLIST` (`PICKLIST_ID`),
  CONSTRAINT `PCKLST_STHST_SVC` FOREIGN KEY (`STATUS_ID`, `STATUS_ID_TO`) REFERENCES `STATUS_VALID_CHANGE` (`STATUS_ID`, `STATUS_ID_TO`),
  CONSTRAINT `PCKLST_STHST_TSI` FOREIGN KEY (`STATUS_ID_TO`) 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 `PLATFORM_TYPE`
--

DROP TABLE IF EXISTS `PLATFORM_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PLATFORM_TYPE` (
  `PLATFORM_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PLATFORM_NAME` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `PLATFORM_VERSION` varchar(10) 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 (`PLATFORM_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PORTAL_PAGE`
--

DROP TABLE IF EXISTS `PORTAL_PAGE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PORTAL_PAGE` (
  `PORTAL_PAGE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PORTAL_PAGE_NAME` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `OWNER_USER_LOGIN_ID` varchar(250) COLLATE latin1_general_cs DEFAULT NULL,
  `ORIGINAL_PORTAL_PAGE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PARENT_PORTAL_PAGE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SEQUENCE_NUM` decimal(20,0) DEFAULT NULL,
  `SECURITY_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,
  `HELP_CONTENT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  PRIMARY KEY (`PORTAL_PAGE_ID`),
  KEY `PortPage_PARENT` (`PARENT_PORTAL_PAGE_ID`),
  KEY `PORTPAGE_SECGRP` (`SECURITY_GROUP_ID`),
  KEY `PORTPAL_HELP_CONT` (`HELP_CONTENT_ID`),
  CONSTRAINT `PORTPAGE_SECGRP` FOREIGN KEY (`SECURITY_GROUP_ID`) REFERENCES `SECURITY_GROUP` (`GROUP_ID`),
  CONSTRAINT `PORTPAL_HELP_CONT` FOREIGN KEY (`HELP_CONTENT_ID`) REFERENCES `CONTENT` (`CONTENT_ID`),
  CONSTRAINT `PortPage_PARENT` FOREIGN KEY (`PARENT_PORTAL_PAGE_ID`) REFERENCES `PORTAL_PAGE` (`PORTAL_PAGE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PORTAL_PAGE_COLUMN`
--

DROP TABLE IF EXISTS `PORTAL_PAGE_COLUMN`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PORTAL_PAGE_COLUMN` (
  `PORTAL_PAGE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `COLUMN_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `COLUMN_WIDTH_PIXELS` decimal(20,0) DEFAULT NULL,
  `COLUMN_WIDTH_PERCENTAGE` 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 (`PORTAL_PAGE_ID`,`COLUMN_SEQ_ID`),
  KEY `PRTL_PGCOL_PAGE` (`PORTAL_PAGE_ID`),
  CONSTRAINT `PRTL_PGCOL_PAGE` FOREIGN KEY (`PORTAL_PAGE_ID`) REFERENCES `PORTAL_PAGE` (`PORTAL_PAGE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PORTAL_PAGE_PORTLET`
--

DROP TABLE IF EXISTS `PORTAL_PAGE_PORTLET`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PORTAL_PAGE_PORTLET` (
  `PORTAL_PAGE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PORTAL_PORTLET_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PORTLET_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `COLUMN_SEQ_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 (`PORTAL_PAGE_ID`,`PORTAL_PORTLET_ID`,`PORTLET_SEQ_ID`),
  KEY `PRTL_PGPTLT_PAGE` (`PORTAL_PAGE_ID`),
  KEY `PRTL_PGPTLT_PTLT` (`PORTAL_PORTLET_ID`),
  CONSTRAINT `PRTL_PGPTLT_PAGE` FOREIGN KEY (`PORTAL_PAGE_ID`) REFERENCES `PORTAL_PAGE` (`PORTAL_PAGE_ID`),
  CONSTRAINT `PRTL_PGPTLT_PTLT` FOREIGN KEY (`PORTAL_PORTLET_ID`) REFERENCES `PORTAL_PORTLET` (`PORTAL_PORTLET_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PORTAL_PORTLET`
--

DROP TABLE IF EXISTS `PORTAL_PORTLET`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PORTAL_PORTLET` (
  `PORTAL_PORTLET_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PORTLET_NAME` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `SCREEN_NAME` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `SCREEN_LOCATION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `EDIT_FORM_NAME` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `EDIT_FORM_LOCATION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `SCREENSHOT` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `SECURITY_SERVICE_NAME` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `SECURITY_MAIN_ACTION` 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 (`PORTAL_PORTLET_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PORTLET_ATTRIBUTE`
--

DROP TABLE IF EXISTS `PORTLET_ATTRIBUTE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PORTLET_ATTRIBUTE` (
  `PORTAL_PAGE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PORTAL_PORTLET_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PORTLET_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,
  `ATTR_TYPE` 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 (`PORTAL_PAGE_ID`,`PORTAL_PORTLET_ID`,`PORTLET_SEQ_ID`,`ATTR_NAME`),
  KEY `PTLT_ATTR_PTLT` (`PORTAL_PORTLET_ID`),
  CONSTRAINT `PTLT_ATTR_PTLT` FOREIGN KEY (`PORTAL_PORTLET_ID`) REFERENCES `PORTAL_PORTLET` (`PORTAL_PORTLET_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PORTLET_CATEGORY`
--

DROP TABLE IF EXISTS `PORTLET_CATEGORY`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PORTLET_CATEGORY` (
  `PORTLET_CATEGORY_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 (`PORTLET_CATEGORY_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PORTLET_PORTLET_CATEGORY`
--

DROP TABLE IF EXISTS `PORTLET_PORTLET_CATEGORY`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PORTLET_PORTLET_CATEGORY` (
  `PORTAL_PORTLET_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PORTLET_CATEGORY_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 (`PORTAL_PORTLET_ID`,`PORTLET_CATEGORY_ID`),
  KEY `PPTLTCAT_PTPL` (`PORTAL_PORTLET_ID`),
  KEY `PPTLTCAT_PTLTCAT` (`PORTLET_CATEGORY_ID`),
  CONSTRAINT `PPTLTCAT_PTLTCAT` FOREIGN KEY (`PORTLET_CATEGORY_ID`) REFERENCES `PORTLET_CATEGORY` (`PORTLET_CATEGORY_ID`),
  CONSTRAINT `PPTLTCAT_PTPL` FOREIGN KEY (`PORTAL_PORTLET_ID`) REFERENCES `PORTAL_PORTLET` (`PORTAL_PORTLET_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `POSTAL_ADDRESS`
--

DROP TABLE IF EXISTS `POSTAL_ADDRESS`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `POSTAL_ADDRESS` (
  `CONTACT_MECH_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `TO_NAME` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `ATTN_NAME` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `ADDRESS1` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `ADDRESS2` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `DIRECTIONS` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `CITY` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `POSTAL_CODE` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `POSTAL_CODE_EXT` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `COUNTRY_GEO_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `STATE_PROVINCE_GEO_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `COUNTY_GEO_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `POSTAL_CODE_GEO_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `GEO_POINT_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 (`CONTACT_MECH_ID`),
  KEY `POST_ADDR_CMECH` (`CONTACT_MECH_ID`),
  KEY `POST_ADDR_CGEO` (`COUNTRY_GEO_ID`),
  KEY `POST_ADDR_SPGEO` (`STATE_PROVINCE_GEO_ID`),
  KEY `POST_ADDR_CNTG` (`COUNTY_GEO_ID`),
  KEY `POST_ADDR_PCGEO` (`POSTAL_CODE_GEO_ID`),
  KEY `POST_ADDR_GEOPT` (`GEO_POINT_ID`),
  CONSTRAINT `POST_ADDR_CGEO` FOREIGN KEY (`COUNTRY_GEO_ID`) REFERENCES `GEO` (`GEO_ID`),
  CONSTRAINT `POST_ADDR_CMECH` FOREIGN KEY (`CONTACT_MECH_ID`) REFERENCES `CONTACT_MECH` (`CONTACT_MECH_ID`),
  CONSTRAINT `POST_ADDR_CNTG` FOREIGN KEY (`COUNTY_GEO_ID`) REFERENCES `GEO` (`GEO_ID`),
  CONSTRAINT `POST_ADDR_GEOPT` FOREIGN KEY (`GEO_POINT_ID`) REFERENCES `GEO_POINT` (`GEO_POINT_ID`),
  CONSTRAINT `POST_ADDR_PCGEO` FOREIGN KEY (`POSTAL_CODE_GEO_ID`) REFERENCES `GEO` (`GEO_ID`),
  CONSTRAINT `POST_ADDR_SPGEO` FOREIGN KEY (`STATE_PROVINCE_GEO_ID`) REFERENCES `GEO` (`GEO_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `POSTAL_ADDRESS_BOUNDARY`
--

DROP TABLE IF EXISTS `POSTAL_ADDRESS_BOUNDARY`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `POSTAL_ADDRESS_BOUNDARY` (
  `CONTACT_MECH_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `GEO_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 (`CONTACT_MECH_ID`,`GEO_ID`),
  KEY `POST_ADDR_BNDRY` (`CONTACT_MECH_ID`),
  KEY `POST_ADDR_BNDRYGEO` (`GEO_ID`),
  CONSTRAINT `POST_ADDR_BNDRY` FOREIGN KEY (`CONTACT_MECH_ID`) REFERENCES `POSTAL_ADDRESS` (`CONTACT_MECH_ID`),
  CONSTRAINT `POST_ADDR_BNDRYGEO` FOREIGN KEY (`GEO_ID`) REFERENCES `GEO` (`GEO_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PRIORITY_TYPE`
--

DROP TABLE IF EXISTS `PRIORITY_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRIORITY_TYPE` (
  `PRIORITY_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 (`PRIORITY_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PRODUCT`
--

DROP TABLE IF EXISTS `PRODUCT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT` (
  `PRODUCT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PRIMARY_PRODUCT_CATEGORY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `MANUFACTURER_PARTY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `FACILITY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `INTRODUCTION_DATE` datetime DEFAULT NULL,
  `RELEASE_DATE` datetime DEFAULT NULL,
  `SUPPORT_DISCONTINUATION_DATE` datetime DEFAULT NULL,
  `SALES_DISCONTINUATION_DATE` datetime DEFAULT NULL,
  `SALES_DISC_WHEN_NOT_AVAIL` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `INTERNAL_NAME` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `BRAND_NAME` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `COMMENTS` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `PRODUCT_NAME` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LONG_DESCRIPTION` longtext COLLATE latin1_general_cs,
  `PRICE_DETAIL_TEXT` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `SMALL_IMAGE_URL` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `MEDIUM_IMAGE_URL` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LARGE_IMAGE_URL` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `DETAIL_IMAGE_URL` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `ORIGINAL_IMAGE_URL` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `DETAIL_SCREEN` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `INVENTORY_MESSAGE` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `REQUIRE_INVENTORY` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `QUANTITY_UOM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `QUANTITY_INCLUDED` decimal(18,6) DEFAULT NULL,
  `PIECES_INCLUDED` decimal(20,0) DEFAULT NULL,
  `REQUIRE_AMOUNT` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `FIXED_AMOUNT` decimal(18,2) DEFAULT NULL,
  `AMOUNT_UOM_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `WEIGHT_UOM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `WEIGHT` decimal(18,6) DEFAULT NULL,
  `PRODUCT_WEIGHT` decimal(18,6) DEFAULT NULL,
  `HEIGHT_UOM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PRODUCT_HEIGHT` decimal(18,6) DEFAULT NULL,
  `SHIPPING_HEIGHT` decimal(18,6) DEFAULT NULL,
  `WIDTH_UOM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PRODUCT_WIDTH` decimal(18,6) DEFAULT NULL,
  `SHIPPING_WIDTH` decimal(18,6) DEFAULT NULL,
  `DEPTH_UOM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PRODUCT_DEPTH` decimal(18,6) DEFAULT NULL,
  `SHIPPING_DEPTH` decimal(18,6) DEFAULT NULL,
  `DIAMETER_UOM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PRODUCT_DIAMETER` decimal(18,6) DEFAULT NULL,
  `PRODUCT_RATING` decimal(18,6) DEFAULT NULL,
  `RATING_TYPE_ENUM` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `RETURNABLE` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `TAXABLE` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `CHARGE_SHIPPING` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `AUTO_CREATE_KEYWORDS` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `INCLUDE_IN_PROMOTIONS` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `IS_VIRTUAL` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `IS_VARIANT` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `VIRTUAL_VARIANT_METHOD_ENUM` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ORIGIN_GEO_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `REQUIREMENT_METHOD_ENUM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `BILL_OF_MATERIAL_LEVEL` decimal(20,0) DEFAULT NULL,
  `RESERV_MAX_PERSONS` decimal(18,6) DEFAULT NULL,
  `RESERV2ND_P_P_PERC` decimal(18,6) DEFAULT NULL,
  `RESERV_NTH_P_P_PERC` decimal(18,6) DEFAULT NULL,
  `CONFIG_ID` varchar(20) 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,
  `IN_SHIPPING_BOX` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `DEFAULT_SHIPMENT_BOX_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `LOT_ID_FILLED_IN` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `ORDER_DECIMAL_QUANTITY` 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 (`PRODUCT_ID`),
  KEY `PROD_TYPE` (`PRODUCT_TYPE_ID`),
  KEY `PROD_PRIMARY_CAT` (`PRIMARY_PRODUCT_CATEGORY_ID`),
  KEY `PROD_FACILITY` (`FACILITY_ID`),
  KEY `PROD_MFG_PARTY` (`MANUFACTURER_PARTY_ID`),
  KEY `PROD_QUANT_UOM` (`QUANTITY_UOM_ID`),
  KEY `PROD_AMOUNT_UOMT` (`AMOUNT_UOM_TYPE_ID`),
  KEY `PROD_WEIGHT_UOM` (`WEIGHT_UOM_ID`),
  KEY `PROD_HEIGHT_UOM` (`HEIGHT_UOM_ID`),
  KEY `PROD_WIDTH_UOM` (`WIDTH_UOM_ID`),
  KEY `PROD_DEPTH_UOM` (`DEPTH_UOM_ID`),
  KEY `PROD_DIAMTR_UOM` (`DIAMETER_UOM_ID`),
  KEY `PROD_VVMETHOD_ENUM` (`VIRTUAL_VARIANT_METHOD_ENUM`),
  KEY `PROD_RATE_ENUM` (`RATING_TYPE_ENUM`),
  KEY `PROD_RQMT_ENUM` (`REQUIREMENT_METHOD_ENUM_ID`),
  KEY `PROD_ORG_GEO` (`ORIGIN_GEO_ID`),
  KEY `PROD_CB_USERLOGIN` (`CREATED_BY_USER_LOGIN`),
  KEY `PROD_LMB_USERLOGIN` (`LAST_MODIFIED_BY_USER_LOGIN`),
  KEY `PROD_SHBX_TYPE` (`DEFAULT_SHIPMENT_BOX_TYPE_ID`),
  CONSTRAINT `PROD_AMOUNT_UOMT` FOREIGN KEY (`AMOUNT_UOM_TYPE_ID`) REFERENCES `UOM_TYPE` (`UOM_TYPE_ID`),
  CONSTRAINT `PROD_CB_USERLOGIN` FOREIGN KEY (`CREATED_BY_USER_LOGIN`) REFERENCES `USER_LOGIN` (`USER_LOGIN_ID`),
  CONSTRAINT `PROD_DEPTH_UOM` FOREIGN KEY (`DEPTH_UOM_ID`) REFERENCES `UOM` (`UOM_ID`),
  CONSTRAINT `PROD_DIAMTR_UOM` FOREIGN KEY (`DIAMETER_UOM_ID`) REFERENCES `UOM` (`UOM_ID`),
  CONSTRAINT `PROD_FACILITY` FOREIGN KEY (`FACILITY_ID`) REFERENCES `FACILITY` (`FACILITY_ID`),
  CONSTRAINT `PROD_HEIGHT_UOM` FOREIGN KEY (`HEIGHT_UOM_ID`) REFERENCES `UOM` (`UOM_ID`),
  CONSTRAINT `PROD_LMB_USERLOGIN` FOREIGN KEY (`LAST_MODIFIED_BY_USER_LOGIN`) REFERENCES `USER_LOGIN` (`USER_LOGIN_ID`),
  CONSTRAINT `PROD_MFG_PARTY` FOREIGN KEY (`MANUFACTURER_PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `PROD_ORG_GEO` FOREIGN KEY (`ORIGIN_GEO_ID`) REFERENCES `GEO` (`GEO_ID`),
  CONSTRAINT `PROD_PRIMARY_CAT` FOREIGN KEY (`PRIMARY_PRODUCT_CATEGORY_ID`) REFERENCES `PRODUCT_CATEGORY` (`PRODUCT_CATEGORY_ID`),
  CONSTRAINT `PROD_QUANT_UOM` FOREIGN KEY (`QUANTITY_UOM_ID`) REFERENCES `UOM` (`UOM_ID`),
  CONSTRAINT `PROD_RATE_ENUM` FOREIGN KEY (`RATING_TYPE_ENUM`) REFERENCES `ENUMERATION` (`ENUM_ID`),
  CONSTRAINT `PROD_RQMT_ENUM` FOREIGN KEY (`REQUIREMENT_METHOD_ENUM_ID`) REFERENCES `ENUMERATION` (`ENUM_ID`),
  CONSTRAINT `PROD_SHBX_TYPE` FOREIGN KEY (`DEFAULT_SHIPMENT_BOX_TYPE_ID`) REFERENCES `SHIPMENT_BOX_TYPE` (`SHIPMENT_BOX_TYPE_ID`),
  CONSTRAINT `PROD_TYPE` FOREIGN KEY (`PRODUCT_TYPE_ID`) REFERENCES `PRODUCT_TYPE` (`PRODUCT_TYPE_ID`),
  CONSTRAINT `PROD_VVMETHOD_ENUM` FOREIGN KEY (`VIRTUAL_VARIANT_METHOD_ENUM`) REFERENCES `ENUMERATION` (`ENUM_ID`),
  CONSTRAINT `PROD_WEIGHT_UOM` FOREIGN KEY (`WEIGHT_UOM_ID`) REFERENCES `UOM` (`UOM_ID`),
  CONSTRAINT `PROD_WIDTH_UOM` FOREIGN KEY (`WIDTH_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 `PRODUCT_ASSOC`
--

DROP TABLE IF EXISTS `PRODUCT_ASSOC`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_ASSOC` (
  `PRODUCT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_ID_TO` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_ASSOC_TYPE_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,
  `REASON` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `QUANTITY` decimal(18,6) DEFAULT NULL,
  `SCRAP_FACTOR` decimal(18,6) DEFAULT NULL,
  `INSTRUCTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `ROUTING_WORK_EFFORT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ESTIMATE_CALC_METHOD` 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 (`PRODUCT_ID`,`PRODUCT_ID_TO`,`PRODUCT_ASSOC_TYPE_ID`,`FROM_DATE`),
  KEY `PROD_ASSOC_TYPE` (`PRODUCT_ASSOC_TYPE_ID`),
  KEY `PROD_ASSOC_MPROD` (`PRODUCT_ID`),
  KEY `PROD_ASSOC_APROD` (`PRODUCT_ID_TO`),
  KEY `PROD_ASSOC_RTWE` (`ROUTING_WORK_EFFORT_ID`),
  KEY `PROD_ASSOC_CUSM` (`ESTIMATE_CALC_METHOD`),
  KEY `PROD_ASSOC_RECINFO` (`RECURRENCE_INFO_ID`),
  CONSTRAINT `PROD_ASSOC_APROD` FOREIGN KEY (`PRODUCT_ID_TO`) REFERENCES `PRODUCT` (`PRODUCT_ID`),
  CONSTRAINT `PROD_ASSOC_CUSM` FOREIGN KEY (`ESTIMATE_CALC_METHOD`) REFERENCES `CUSTOM_METHOD` (`CUSTOM_METHOD_ID`),
  CONSTRAINT `PROD_ASSOC_MPROD` FOREIGN KEY (`PRODUCT_ID`) REFERENCES `PRODUCT` (`PRODUCT_ID`),
  CONSTRAINT `PROD_ASSOC_RECINFO` FOREIGN KEY (`RECURRENCE_INFO_ID`) REFERENCES `RECURRENCE_INFO` (`RECURRENCE_INFO_ID`),
  CONSTRAINT `PROD_ASSOC_RTWE` FOREIGN KEY (`ROUTING_WORK_EFFORT_ID`) REFERENCES `WORK_EFFORT` (`WORK_EFFORT_ID`),
  CONSTRAINT `PROD_ASSOC_TYPE` FOREIGN KEY (`PRODUCT_ASSOC_TYPE_ID`) REFERENCES `PRODUCT_ASSOC_TYPE` (`PRODUCT_ASSOC_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PRODUCT_ASSOC_TYPE`
--

DROP TABLE IF EXISTS `PRODUCT_ASSOC_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_ASSOC_TYPE` (
  `PRODUCT_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 (`PRODUCT_ASSOC_TYPE_ID`),
  KEY `PROD_ASSOC_TYPEPAR` (`PARENT_TYPE_ID`),
  CONSTRAINT `PROD_ASSOC_TYPEPAR` FOREIGN KEY (`PARENT_TYPE_ID`) REFERENCES `PRODUCT_ASSOC_TYPE` (`PRODUCT_ASSOC_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PRODUCT_ATTRIBUTE`
--

DROP TABLE IF EXISTS `PRODUCT_ATTRIBUTE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_ATTRIBUTE` (
  `PRODUCT_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,
  `ATTR_TYPE` 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 (`PRODUCT_ID`,`ATTR_NAME`),
  KEY `PROD_ATTR` (`PRODUCT_ID`),
  CONSTRAINT `PROD_ATTR` 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 `PRODUCT_AVERAGE_COST`
--

DROP TABLE IF EXISTS `PRODUCT_AVERAGE_COST`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_AVERAGE_COST` (
  `PRODUCT_AVERAGE_COST_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ORGANIZATION_PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FACILITY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FROM_DATE` datetime NOT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `AVERAGE_COST` 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 (`PRODUCT_AVERAGE_COST_TYPE_ID`,`ORGANIZATION_PARTY_ID`,`PRODUCT_ID`,`FACILITY_ID`,`FROM_DATE`),
  KEY `AVG_COST_TYPE` (`PRODUCT_AVERAGE_COST_TYPE_ID`),
  KEY `AVG_COST_PARTY` (`ORGANIZATION_PARTY_ID`),
  KEY `AVG_COST_PROD` (`PRODUCT_ID`),
  KEY `AVG_COST_FACI` (`FACILITY_ID`),
  CONSTRAINT `AVG_COST_FACI` FOREIGN KEY (`FACILITY_ID`) REFERENCES `FACILITY` (`FACILITY_ID`),
  CONSTRAINT `AVG_COST_PARTY` FOREIGN KEY (`ORGANIZATION_PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `AVG_COST_PROD` FOREIGN KEY (`PRODUCT_ID`) REFERENCES `PRODUCT` (`PRODUCT_ID`),
  CONSTRAINT `AVG_COST_TYPE` FOREIGN KEY (`PRODUCT_AVERAGE_COST_TYPE_ID`) REFERENCES `PRODUCT_AVERAGE_COST_TYPE` (`PRODUCT_AVERAGE_COST_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PRODUCT_AVERAGE_COST_TYPE`
--

DROP TABLE IF EXISTS `PRODUCT_AVERAGE_COST_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_AVERAGE_COST_TYPE` (
  `PRODUCT_AVERAGE_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 (`PRODUCT_AVERAGE_COST_TYPE_ID`),
  KEY `AVGCOST_TYPE_PAR` (`PARENT_TYPE_ID`),
  CONSTRAINT `AVGCOST_TYPE_PAR` FOREIGN KEY (`PARENT_TYPE_ID`) REFERENCES `PRODUCT_AVERAGE_COST_TYPE` (`PRODUCT_AVERAGE_COST_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PRODUCT_CALCULATED_INFO`
--

DROP TABLE IF EXISTS `PRODUCT_CALCULATED_INFO`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_CALCULATED_INFO` (
  `PRODUCT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `TOTAL_QUANTITY_ORDERED` decimal(18,6) DEFAULT NULL,
  `TOTAL_TIMES_VIEWED` decimal(20,0) DEFAULT NULL,
  `AVERAGE_CUSTOMER_RATING` 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 (`PRODUCT_ID`),
  KEY `PRODCI_PROD` (`PRODUCT_ID`),
  CONSTRAINT `PRODCI_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 `PRODUCT_CATEGORY`
--

DROP TABLE IF EXISTS `PRODUCT_CATEGORY`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_CATEGORY` (
  `PRODUCT_CATEGORY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_CATEGORY_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PRIMARY_PARENT_CATEGORY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `CATEGORY_NAME` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LONG_DESCRIPTION` longtext COLLATE latin1_general_cs,
  `CATEGORY_IMAGE_URL` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LINK_ONE_IMAGE_URL` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LINK_TWO_IMAGE_URL` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `DETAIL_SCREEN` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `SHOW_IN_SELECT` 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 (`PRODUCT_CATEGORY_ID`),
  KEY `PROD_CTGRY_TYPE` (`PRODUCT_CATEGORY_TYPE_ID`),
  KEY `PROD_CTGRY_PARENT` (`PRIMARY_PARENT_CATEGORY_ID`),
  CONSTRAINT `PROD_CTGRY_PARENT` FOREIGN KEY (`PRIMARY_PARENT_CATEGORY_ID`) REFERENCES `PRODUCT_CATEGORY` (`PRODUCT_CATEGORY_ID`),
  CONSTRAINT `PROD_CTGRY_TYPE` FOREIGN KEY (`PRODUCT_CATEGORY_TYPE_ID`) REFERENCES `PRODUCT_CATEGORY_TYPE` (`PRODUCT_CATEGORY_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PRODUCT_CATEGORY_ATTRIBUTE`
--

DROP TABLE IF EXISTS `PRODUCT_CATEGORY_ATTRIBUTE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_CATEGORY_ATTRIBUTE` (
  `PRODUCT_CATEGORY_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 (`PRODUCT_CATEGORY_ID`,`ATTR_NAME`),
  KEY `PROD_CTGRY_ATTR` (`PRODUCT_CATEGORY_ID`),
  CONSTRAINT `PROD_CTGRY_ATTR` FOREIGN KEY (`PRODUCT_CATEGORY_ID`) REFERENCES `PRODUCT_CATEGORY` (`PRODUCT_CATEGORY_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PRODUCT_CATEGORY_CONTENT`
--

DROP TABLE IF EXISTS `PRODUCT_CATEGORY_CONTENT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_CATEGORY_CONTENT` (
  `PRODUCT_CATEGORY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CONTENT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PROD_CAT_CONTENT_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FROM_DATE` datetime NOT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `PURCHASE_FROM_DATE` datetime DEFAULT NULL,
  `PURCHASE_THRU_DATE` datetime DEFAULT NULL,
  `USE_COUNT_LIMIT` decimal(20,0) DEFAULT NULL,
  `USE_DAYS_LIMIT` 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 (`PRODUCT_CATEGORY_ID`,`CONTENT_ID`,`PROD_CAT_CONTENT_TYPE_ID`,`FROM_DATE`),
  KEY `PRDCAT_CNT_PRDCAT` (`PRODUCT_CATEGORY_ID`),
  KEY `PRDCAT_CNT_CNT` (`CONTENT_ID`),
  KEY `PRDCAT_CNT_TYPE` (`PROD_CAT_CONTENT_TYPE_ID`),
  CONSTRAINT `PRDCAT_CNT_CNT` FOREIGN KEY (`CONTENT_ID`) REFERENCES `CONTENT` (`CONTENT_ID`),
  CONSTRAINT `PRDCAT_CNT_PRDCAT` FOREIGN KEY (`PRODUCT_CATEGORY_ID`) REFERENCES `PRODUCT_CATEGORY` (`PRODUCT_CATEGORY_ID`),
  CONSTRAINT `PRDCAT_CNT_TYPE` FOREIGN KEY (`PROD_CAT_CONTENT_TYPE_ID`) REFERENCES `PRODUCT_CATEGORY_CONTENT_TYPE` (`PROD_CAT_CONTENT_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PRODUCT_CATEGORY_CONTENT_TYPE`
--

DROP TABLE IF EXISTS `PRODUCT_CATEGORY_CONTENT_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_CATEGORY_CONTENT_TYPE` (
  `PROD_CAT_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 (`PROD_CAT_CONTENT_TYPE_ID`),
  KEY `PRDCATCNT_TYP_PAR` (`PARENT_TYPE_ID`),
  CONSTRAINT `PRDCATCNT_TYP_PAR` FOREIGN KEY (`PARENT_TYPE_ID`) REFERENCES `PRODUCT_CATEGORY_CONTENT_TYPE` (`PROD_CAT_CONTENT_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PRODUCT_CATEGORY_GL_ACCOUNT`
--

DROP TABLE IF EXISTS `PRODUCT_CATEGORY_GL_ACCOUNT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_CATEGORY_GL_ACCOUNT` (
  `PRODUCT_CATEGORY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ORGANIZATION_PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `GL_ACCOUNT_TYPE_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 (`PRODUCT_CATEGORY_ID`,`ORGANIZATION_PARTY_ID`,`GL_ACCOUNT_TYPE_ID`),
  KEY `PRD_CT_GLACT_PCAT` (`PRODUCT_CATEGORY_ID`),
  KEY `PRD_CT_GLACT_PRTY` (`ORGANIZATION_PARTY_ID`),
  KEY `PRD_CT_GLACT_TYPE` (`GL_ACCOUNT_TYPE_ID`),
  KEY `PRD_CT_GLACT_GLACT` (`GL_ACCOUNT_ID`),
  CONSTRAINT `PRD_CT_GLACT_GLACT` FOREIGN KEY (`GL_ACCOUNT_ID`) REFERENCES `GL_ACCOUNT` (`GL_ACCOUNT_ID`),
  CONSTRAINT `PRD_CT_GLACT_PCAT` FOREIGN KEY (`PRODUCT_CATEGORY_ID`) REFERENCES `PRODUCT_CATEGORY` (`PRODUCT_CATEGORY_ID`),
  CONSTRAINT `PRD_CT_GLACT_PRTY` FOREIGN KEY (`ORGANIZATION_PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `PRD_CT_GLACT_TYPE` FOREIGN KEY (`GL_ACCOUNT_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 `PRODUCT_CATEGORY_LINK`
--

DROP TABLE IF EXISTS `PRODUCT_CATEGORY_LINK`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_CATEGORY_LINK` (
  `PRODUCT_CATEGORY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `LINK_SEQ_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,
  `TITLE_TEXT` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `DETAIL_TEXT` longtext COLLATE latin1_general_cs,
  `IMAGE_URL` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `IMAGE_TWO_URL` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LINK_TYPE_ENUM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `LINK_INFO` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `DETAIL_SUB_SCREEN` 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 (`PRODUCT_CATEGORY_ID`,`LINK_SEQ_ID`,`FROM_DATE`),
  KEY `PROD_CLNK_CATEGORY` (`PRODUCT_CATEGORY_ID`),
  KEY `PROD_CLNK_LKTPENM` (`LINK_TYPE_ENUM_ID`),
  CONSTRAINT `PROD_CLNK_CATEGORY` FOREIGN KEY (`PRODUCT_CATEGORY_ID`) REFERENCES `PRODUCT_CATEGORY` (`PRODUCT_CATEGORY_ID`),
  CONSTRAINT `PROD_CLNK_LKTPENM` FOREIGN KEY (`LINK_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 `PRODUCT_CATEGORY_MEMBER`
--

DROP TABLE IF EXISTS `PRODUCT_CATEGORY_MEMBER`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_CATEGORY_MEMBER` (
  `PRODUCT_CATEGORY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_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,
  `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`,`PRODUCT_ID`,`FROM_DATE`),
  KEY `PROD_CMBR_PRODUCT` (`PRODUCT_ID`),
  KEY `PROD_CMBR_CATEGORY` (`PRODUCT_CATEGORY_ID`),
  CONSTRAINT `PROD_CMBR_CATEGORY` FOREIGN KEY (`PRODUCT_CATEGORY_ID`) REFERENCES `PRODUCT_CATEGORY` (`PRODUCT_CATEGORY_ID`),
  CONSTRAINT `PROD_CMBR_PRODUCT` 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 `PRODUCT_CATEGORY_ROLE`
--

DROP TABLE IF EXISTS `PRODUCT_CATEGORY_ROLE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_CATEGORY_ROLE` (
  `PRODUCT_CATEGORY_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,
  `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 (`PRODUCT_CATEGORY_ID`,`PARTY_ID`,`ROLE_TYPE_ID`,`FROM_DATE`),
  KEY `PROD_CRLE_PTYRLE` (`PARTY_ID`,`ROLE_TYPE_ID`),
  KEY `PROD_CRLE_CATEGORY` (`PRODUCT_CATEGORY_ID`),
  CONSTRAINT `PROD_CRLE_CATEGORY` FOREIGN KEY (`PRODUCT_CATEGORY_ID`) REFERENCES `PRODUCT_CATEGORY` (`PRODUCT_CATEGORY_ID`),
  CONSTRAINT `PROD_CRLE_PTYRLE` 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 `PRODUCT_CATEGORY_ROLLUP`
--

DROP TABLE IF EXISTS `PRODUCT_CATEGORY_ROLLUP`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_CATEGORY_ROLLUP` (
  `PRODUCT_CATEGORY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARENT_PRODUCT_CATEGORY_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 (`PRODUCT_CATEGORY_ID`,`PARENT_PRODUCT_CATEGORY_ID`,`FROM_DATE`),
  KEY `PROD_CRLP_CURRENT` (`PRODUCT_CATEGORY_ID`),
  KEY `PROD_CRLP_PARENT` (`PARENT_PRODUCT_CATEGORY_ID`),
  CONSTRAINT `PROD_CRLP_CURRENT` FOREIGN KEY (`PRODUCT_CATEGORY_ID`) REFERENCES `PRODUCT_CATEGORY` (`PRODUCT_CATEGORY_ID`),
  CONSTRAINT `PROD_CRLP_PARENT` FOREIGN KEY (`PARENT_PRODUCT_CATEGORY_ID`) REFERENCES `PRODUCT_CATEGORY` (`PRODUCT_CATEGORY_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PRODUCT_CATEGORY_TYPE`
--

DROP TABLE IF EXISTS `PRODUCT_CATEGORY_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_CATEGORY_TYPE` (
  `PRODUCT_CATEGORY_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 (`PRODUCT_CATEGORY_TYPE_ID`),
  KEY `PROD_CTGRY_TYPEPAR` (`PARENT_TYPE_ID`),
  CONSTRAINT `PROD_CTGRY_TYPEPAR` FOREIGN KEY (`PARENT_TYPE_ID`) REFERENCES `PRODUCT_CATEGORY_TYPE` (`PRODUCT_CATEGORY_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PRODUCT_CATEGORY_TYPE_ATTR`
--

DROP TABLE IF EXISTS `PRODUCT_CATEGORY_TYPE_ATTR`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_CATEGORY_TYPE_ATTR` (
  `PRODUCT_CATEGORY_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 (`PRODUCT_CATEGORY_TYPE_ID`,`ATTR_NAME`),
  KEY `PROD_CTGRY_TATTR` (`PRODUCT_CATEGORY_TYPE_ID`),
  CONSTRAINT `PROD_CTGRY_TATTR` FOREIGN KEY (`PRODUCT_CATEGORY_TYPE_ID`) REFERENCES `PRODUCT_CATEGORY_TYPE` (`PRODUCT_CATEGORY_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PRODUCT_CONFIG`
--

DROP TABLE IF EXISTS `PRODUCT_CONFIG`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_CONFIG` (
  `PRODUCT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CONFIG_ITEM_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `SEQUENCE_NUM` decimal(20,0) NOT NULL,
  `FROM_DATE` datetime NOT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LONG_DESCRIPTION` longtext COLLATE latin1_general_cs,
  `CONFIG_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `DEFAULT_CONFIG_OPTION_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `IS_MANDATORY` 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 (`PRODUCT_ID`,`CONFIG_ITEM_ID`,`SEQUENCE_NUM`,`FROM_DATE`),
  KEY `PROD_CONF_PROD` (`PRODUCT_ID`),
  KEY `PROD_CONF_ITEM` (`CONFIG_ITEM_ID`),
  CONSTRAINT `PROD_CONF_ITEM` FOREIGN KEY (`CONFIG_ITEM_ID`) REFERENCES `PRODUCT_CONFIG_ITEM` (`CONFIG_ITEM_ID`),
  CONSTRAINT `PROD_CONF_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 `PRODUCT_CONFIG_CONFIG`
--

DROP TABLE IF EXISTS `PRODUCT_CONFIG_CONFIG`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_CONFIG_CONFIG` (
  `CONFIG_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CONFIG_ITEM_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `SEQUENCE_NUM` decimal(20,0) NOT NULL,
  `CONFIG_OPTION_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 (`CONFIG_ID`,`CONFIG_ITEM_ID`,`CONFIG_OPTION_ID`,`SEQUENCE_NUM`),
  KEY `PROD_CONFC_ITEM` (`CONFIG_ITEM_ID`),
  KEY `PROD_CONFC_OPTN` (`CONFIG_ITEM_ID`,`CONFIG_OPTION_ID`),
  CONSTRAINT `PROD_CONFC_ITEM` FOREIGN KEY (`CONFIG_ITEM_ID`) REFERENCES `PRODUCT_CONFIG_ITEM` (`CONFIG_ITEM_ID`),
  CONSTRAINT `PROD_CONFC_OPTN` FOREIGN KEY (`CONFIG_ITEM_ID`, `CONFIG_OPTION_ID`) REFERENCES `PRODUCT_CONFIG_OPTION` (`CONFIG_ITEM_ID`, `CONFIG_OPTION_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PRODUCT_CONFIG_ITEM`
--

DROP TABLE IF EXISTS `PRODUCT_CONFIG_ITEM`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_CONFIG_ITEM` (
  `CONFIG_ITEM_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CONFIG_ITEM_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `CONFIG_ITEM_NAME` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LONG_DESCRIPTION` longtext COLLATE latin1_general_cs,
  `IMAGE_URL` 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 (`CONFIG_ITEM_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PRODUCT_CONFIG_OPTION`
--

DROP TABLE IF EXISTS `PRODUCT_CONFIG_OPTION`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_CONFIG_OPTION` (
  `CONFIG_ITEM_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CONFIG_OPTION_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CONFIG_OPTION_NAME` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `DESCRIPTION` varchar(255) 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 (`CONFIG_ITEM_ID`,`CONFIG_OPTION_ID`),
  KEY `PROD_OPTN_ITEM` (`CONFIG_ITEM_ID`),
  CONSTRAINT `PROD_OPTN_ITEM` FOREIGN KEY (`CONFIG_ITEM_ID`) REFERENCES `PRODUCT_CONFIG_ITEM` (`CONFIG_ITEM_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PRODUCT_CONFIG_OPTION_IACTN`
--

DROP TABLE IF EXISTS `PRODUCT_CONFIG_OPTION_IACTN`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_CONFIG_OPTION_IACTN` (
  `CONFIG_ITEM_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CONFIG_OPTION_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CONFIG_ITEM_ID_TO` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CONFIG_OPTION_ID_TO` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `SEQUENCE_NUM` decimal(20,0) NOT NULL,
  `CONFIG_IACTN_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 (`CONFIG_ITEM_ID`,`CONFIG_OPTION_ID`,`CONFIG_ITEM_ID_TO`,`CONFIG_OPTION_ID_TO`,`SEQUENCE_NUM`),
  KEY `PROD_OPTIA_ITEM` (`CONFIG_ITEM_ID`),
  KEY `PROD_OPTIA_OPTN` (`CONFIG_ITEM_ID`,`CONFIG_OPTION_ID`),
  KEY `PROD_OPTIA_ITMT` (`CONFIG_ITEM_ID_TO`),
  KEY `PROD_OPTIA_OPTT` (`CONFIG_ITEM_ID_TO`,`CONFIG_OPTION_ID_TO`),
  CONSTRAINT `PROD_OPTIA_ITEM` FOREIGN KEY (`CONFIG_ITEM_ID`) REFERENCES `PRODUCT_CONFIG_ITEM` (`CONFIG_ITEM_ID`),
  CONSTRAINT `PROD_OPTIA_ITMT` FOREIGN KEY (`CONFIG_ITEM_ID_TO`) REFERENCES `PRODUCT_CONFIG_ITEM` (`CONFIG_ITEM_ID`),
  CONSTRAINT `PROD_OPTIA_OPTN` FOREIGN KEY (`CONFIG_ITEM_ID`, `CONFIG_OPTION_ID`) REFERENCES `PRODUCT_CONFIG_OPTION` (`CONFIG_ITEM_ID`, `CONFIG_OPTION_ID`),
  CONSTRAINT `PROD_OPTIA_OPTT` FOREIGN KEY (`CONFIG_ITEM_ID_TO`, `CONFIG_OPTION_ID_TO`) REFERENCES `PRODUCT_CONFIG_OPTION` (`CONFIG_ITEM_ID`, `CONFIG_OPTION_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PRODUCT_CONFIG_PRODUCT`
--

DROP TABLE IF EXISTS `PRODUCT_CONFIG_PRODUCT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_CONFIG_PRODUCT` (
  `CONFIG_ITEM_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CONFIG_OPTION_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `QUANTITY` decimal(18,6) 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 (`CONFIG_ITEM_ID`,`CONFIG_OPTION_ID`,`PRODUCT_ID`),
  KEY `PROD_CONFP_ITEM` (`CONFIG_ITEM_ID`),
  KEY `PROD_CONFP_OPTN` (`CONFIG_ITEM_ID`,`CONFIG_OPTION_ID`),
  KEY `PROD_CONFP_PROD` (`PRODUCT_ID`),
  CONSTRAINT `PROD_CONFP_ITEM` FOREIGN KEY (`CONFIG_ITEM_ID`) REFERENCES `PRODUCT_CONFIG_ITEM` (`CONFIG_ITEM_ID`),
  CONSTRAINT `PROD_CONFP_OPTN` FOREIGN KEY (`CONFIG_ITEM_ID`, `CONFIG_OPTION_ID`) REFERENCES `PRODUCT_CONFIG_OPTION` (`CONFIG_ITEM_ID`, `CONFIG_OPTION_ID`),
  CONSTRAINT `PROD_CONFP_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 `PRODUCT_CONFIG_STATS`
--

DROP TABLE IF EXISTS `PRODUCT_CONFIG_STATS`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_CONFIG_STATS` (
  `CONFIG_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `NUM_OF_CONFS` decimal(20,0) DEFAULT NULL,
  `CONFIG_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 (`CONFIG_ID`,`PRODUCT_ID`),
  KEY `PROD_CONFS_PROD` (`PRODUCT_ID`),
  CONSTRAINT `PROD_CONFS_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 `PRODUCT_CONTENT`
--

DROP TABLE IF EXISTS `PRODUCT_CONTENT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_CONTENT` (
  `PRODUCT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CONTENT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_CONTENT_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FROM_DATE` datetime NOT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `PURCHASE_FROM_DATE` datetime DEFAULT NULL,
  `PURCHASE_THRU_DATE` datetime DEFAULT NULL,
  `USE_COUNT_LIMIT` decimal(20,0) DEFAULT NULL,
  `USE_TIME` decimal(20,0) DEFAULT NULL,
  `USE_TIME_UOM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `USE_ROLE_TYPE_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 (`PRODUCT_ID`,`CONTENT_ID`,`PRODUCT_CONTENT_TYPE_ID`,`FROM_DATE`),
  KEY `PROD_CNT_PROD` (`PRODUCT_ID`),
  KEY `PROD_CNT_CNT` (`CONTENT_ID`),
  KEY `PROD_CNT_TYPE` (`PRODUCT_CONTENT_TYPE_ID`),
  KEY `PROD_CNT_URT` (`USE_ROLE_TYPE_ID`),
  KEY `PROD_CNT_UTU` (`USE_TIME_UOM_ID`),
  CONSTRAINT `PROD_CNT_CNT` FOREIGN KEY (`CONTENT_ID`) REFERENCES `CONTENT` (`CONTENT_ID`),
  CONSTRAINT `PROD_CNT_PROD` FOREIGN KEY (`PRODUCT_ID`) REFERENCES `PRODUCT` (`PRODUCT_ID`),
  CONSTRAINT `PROD_CNT_TYPE` FOREIGN KEY (`PRODUCT_CONTENT_TYPE_ID`) REFERENCES `PRODUCT_CONTENT_TYPE` (`PRODUCT_CONTENT_TYPE_ID`),
  CONSTRAINT `PROD_CNT_URT` FOREIGN KEY (`USE_ROLE_TYPE_ID`) REFERENCES `ROLE_TYPE` (`ROLE_TYPE_ID`),
  CONSTRAINT `PROD_CNT_UTU` FOREIGN KEY (`USE_TIME_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 `PRODUCT_CONTENT_TYPE`
--

DROP TABLE IF EXISTS `PRODUCT_CONTENT_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_CONTENT_TYPE` (
  `PRODUCT_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 (`PRODUCT_CONTENT_TYPE_ID`),
  KEY `PRDCT_TYP_PARENT` (`PARENT_TYPE_ID`),
  CONSTRAINT `PRDCT_TYP_PARENT` FOREIGN KEY (`PARENT_TYPE_ID`) REFERENCES `PRODUCT_CONTENT_TYPE` (`PRODUCT_CONTENT_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PRODUCT_COST_COMPONENT_CALC`
--

DROP TABLE IF EXISTS `PRODUCT_COST_COMPONENT_CALC`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_COST_COMPONENT_CALC` (
  `PRODUCT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `COST_COMPONENT_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `COST_COMPONENT_CALC_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `FROM_DATE` datetime NOT NULL,
  `SEQUENCE_NUM` decimal(20,0) 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 (`PRODUCT_ID`,`COST_COMPONENT_TYPE_ID`,`FROM_DATE`),
  KEY `PR_COS_COMPCALC` (`PRODUCT_ID`),
  KEY `PR_COS_CCT` (`COST_COMPONENT_TYPE_ID`),
  KEY `PR_COS_CCC` (`COST_COMPONENT_CALC_ID`),
  CONSTRAINT `PR_COS_CCC` FOREIGN KEY (`COST_COMPONENT_CALC_ID`) REFERENCES `COST_COMPONENT_CALC` (`COST_COMPONENT_CALC_ID`),
  CONSTRAINT `PR_COS_CCT` FOREIGN KEY (`COST_COMPONENT_TYPE_ID`) REFERENCES `COST_COMPONENT_TYPE` (`COST_COMPONENT_TYPE_ID`),
  CONSTRAINT `PR_COS_COMPCALC` 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 `PRODUCT_FACILITY`
--

DROP TABLE IF EXISTS `PRODUCT_FACILITY`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_FACILITY` (
  `PRODUCT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FACILITY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `MINIMUM_STOCK` decimal(18,6) DEFAULT NULL,
  `REORDER_QUANTITY` decimal(18,6) DEFAULT NULL,
  `DAYS_TO_SHIP` decimal(20,0) DEFAULT NULL,
  `LAST_INVENTORY_COUNT` 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 (`PRODUCT_ID`,`FACILITY_ID`),
  KEY `PROD_FAC_PROD` (`PRODUCT_ID`),
  KEY `PROD_FAC_FAC` (`FACILITY_ID`),
  CONSTRAINT `PROD_FAC_FAC` FOREIGN KEY (`FACILITY_ID`) REFERENCES `FACILITY` (`FACILITY_ID`),
  CONSTRAINT `PROD_FAC_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 `PRODUCT_FACILITY_LOCATION`
--

DROP TABLE IF EXISTS `PRODUCT_FACILITY_LOCATION`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_FACILITY_LOCATION` (
  `PRODUCT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FACILITY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `LOCATION_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `MINIMUM_STOCK` decimal(18,6) DEFAULT NULL,
  `MOVE_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 (`PRODUCT_ID`,`FACILITY_ID`,`LOCATION_SEQ_ID`),
  KEY `PROD_FCL_PROD` (`PRODUCT_ID`),
  KEY `PROD_FCL_FCL` (`FACILITY_ID`,`LOCATION_SEQ_ID`),
  CONSTRAINT `PROD_FCL_FCL` FOREIGN KEY (`FACILITY_ID`, `LOCATION_SEQ_ID`) REFERENCES `FACILITY_LOCATION` (`FACILITY_ID`, `LOCATION_SEQ_ID`),
  CONSTRAINT `PROD_FCL_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 `PRODUCT_FEATURE`
--

DROP TABLE IF EXISTS `PRODUCT_FEATURE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_FEATURE` (
  `PRODUCT_FEATURE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_FEATURE_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PRODUCT_FEATURE_CATEGORY_ID` varchar(20) 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,
  `NUMBER_SPECIFIED` decimal(18,6) DEFAULT NULL,
  `DEFAULT_AMOUNT` decimal(18,2) DEFAULT NULL,
  `DEFAULT_SEQUENCE_NUM` decimal(20,0) DEFAULT NULL,
  `ABBREV` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ID_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 (`PRODUCT_FEATURE_ID`),
  KEY `PROD_FEAT_CATEGORY` (`PRODUCT_FEATURE_CATEGORY_ID`),
  KEY `PROD_FEAT_TYPE` (`PRODUCT_FEATURE_TYPE_ID`),
  KEY `PROD_FEAT_UOM` (`UOM_ID`),
  CONSTRAINT `PROD_FEAT_CATEGORY` FOREIGN KEY (`PRODUCT_FEATURE_CATEGORY_ID`) REFERENCES `PRODUCT_FEATURE_CATEGORY` (`PRODUCT_FEATURE_CATEGORY_ID`),
  CONSTRAINT `PROD_FEAT_TYPE` FOREIGN KEY (`PRODUCT_FEATURE_TYPE_ID`) REFERENCES `PRODUCT_FEATURE_TYPE` (`PRODUCT_FEATURE_TYPE_ID`),
  CONSTRAINT `PROD_FEAT_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 `PRODUCT_FEATURE_APPL`
--

DROP TABLE IF EXISTS `PRODUCT_FEATURE_APPL`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_FEATURE_APPL` (
  `PRODUCT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_FEATURE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_FEATURE_APPL_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `FROM_DATE` datetime NOT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `SEQUENCE_NUM` decimal(20,0) DEFAULT NULL,
  `AMOUNT` decimal(18,2) DEFAULT NULL,
  `RECURRING_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 (`PRODUCT_ID`,`PRODUCT_FEATURE_ID`,`FROM_DATE`),
  KEY `PROD_FAPPL_TYPE` (`PRODUCT_FEATURE_APPL_TYPE_ID`),
  KEY `PROD_FAPPL_PRODUCT` (`PRODUCT_ID`),
  KEY `PROD_FAPPL_FEATURE` (`PRODUCT_FEATURE_ID`),
  CONSTRAINT `PROD_FAPPL_FEATURE` FOREIGN KEY (`PRODUCT_FEATURE_ID`) REFERENCES `PRODUCT_FEATURE` (`PRODUCT_FEATURE_ID`),
  CONSTRAINT `PROD_FAPPL_PRODUCT` FOREIGN KEY (`PRODUCT_ID`) REFERENCES `PRODUCT` (`PRODUCT_ID`),
  CONSTRAINT `PROD_FAPPL_TYPE` FOREIGN KEY (`PRODUCT_FEATURE_APPL_TYPE_ID`) REFERENCES `PRODUCT_FEATURE_APPL_TYPE` (`PRODUCT_FEATURE_APPL_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PRODUCT_FEATURE_APPL_ATTR`
--

DROP TABLE IF EXISTS `PRODUCT_FEATURE_APPL_ATTR`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_FEATURE_APPL_ATTR` (
  `PRODUCT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_FEATURE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FROM_DATE` datetime 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 (`PRODUCT_ID`,`PRODUCT_FEATURE_ID`,`FROM_DATE`,`ATTR_NAME`),
  KEY `PROD_FAPPA_PRODUCT` (`PRODUCT_ID`),
  KEY `PROD_FAPPA_FEATURE` (`PRODUCT_FEATURE_ID`),
  KEY `PROD_FAPPA_FEATAPP` (`PRODUCT_ID`,`PRODUCT_FEATURE_ID`,`FROM_DATE`),
  CONSTRAINT `PROD_FAPPA_FEATAPP` FOREIGN KEY (`PRODUCT_ID`, `PRODUCT_FEATURE_ID`, `FROM_DATE`) REFERENCES `PRODUCT_FEATURE_APPL` (`PRODUCT_ID`, `PRODUCT_FEATURE_ID`, `FROM_DATE`),
  CONSTRAINT `PROD_FAPPA_FEATURE` FOREIGN KEY (`PRODUCT_FEATURE_ID`) REFERENCES `PRODUCT_FEATURE` (`PRODUCT_FEATURE_ID`),
  CONSTRAINT `PROD_FAPPA_PRODUCT` 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 `PRODUCT_FEATURE_APPL_TYPE`
--

DROP TABLE IF EXISTS `PRODUCT_FEATURE_APPL_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_FEATURE_APPL_TYPE` (
  `PRODUCT_FEATURE_APPL_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 (`PRODUCT_FEATURE_APPL_TYPE_ID`),
  KEY `PROD_FAPPL_TYPPAR` (`PARENT_TYPE_ID`),
  CONSTRAINT `PROD_FAPPL_TYPPAR` FOREIGN KEY (`PARENT_TYPE_ID`) REFERENCES `PRODUCT_FEATURE_APPL_TYPE` (`PRODUCT_FEATURE_APPL_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PRODUCT_FEATURE_CATEGORY`
--

DROP TABLE IF EXISTS `PRODUCT_FEATURE_CATEGORY`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_FEATURE_CATEGORY` (
  `PRODUCT_FEATURE_CATEGORY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARENT_CATEGORY_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 (`PRODUCT_FEATURE_CATEGORY_ID`),
  KEY `PROD_FEAT_CAT_PAR` (`PARENT_CATEGORY_ID`),
  CONSTRAINT `PROD_FEAT_CAT_PAR` FOREIGN KEY (`PARENT_CATEGORY_ID`) REFERENCES `PRODUCT_FEATURE_CATEGORY` (`PRODUCT_FEATURE_CATEGORY_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PRODUCT_FEATURE_CATEGORY_APPL`
--

DROP TABLE IF EXISTS `PRODUCT_FEATURE_CATEGORY_APPL`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_FEATURE_CATEGORY_APPL` (
  `PRODUCT_CATEGORY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_FEATURE_CATEGORY_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`,`PRODUCT_FEATURE_CATEGORY_ID`,`FROM_DATE`),
  KEY `PROD_FCAPPL_CAT` (`PRODUCT_CATEGORY_ID`),
  KEY `PROD_FCAPPL_FCAT` (`PRODUCT_FEATURE_CATEGORY_ID`),
  CONSTRAINT `PROD_FCAPPL_CAT` FOREIGN KEY (`PRODUCT_CATEGORY_ID`) REFERENCES `PRODUCT_CATEGORY` (`PRODUCT_CATEGORY_ID`),
  CONSTRAINT `PROD_FCAPPL_FCAT` FOREIGN KEY (`PRODUCT_FEATURE_CATEGORY_ID`) REFERENCES `PRODUCT_FEATURE_CATEGORY` (`PRODUCT_FEATURE_CATEGORY_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PRODUCT_FEATURE_CAT_GRP_APPL`
--

DROP TABLE IF EXISTS `PRODUCT_FEATURE_CAT_GRP_APPL`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_FEATURE_CAT_GRP_APPL` (
  `PRODUCT_CATEGORY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_FEATURE_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`,`PRODUCT_FEATURE_GROUP_ID`,`FROM_DATE`),
  KEY `PROD_FCGAPL_CAT` (`PRODUCT_CATEGORY_ID`),
  KEY `PROD_FCGAPL_FGRP` (`PRODUCT_FEATURE_GROUP_ID`),
  CONSTRAINT `PROD_FCGAPL_CAT` FOREIGN KEY (`PRODUCT_CATEGORY_ID`) REFERENCES `PRODUCT_CATEGORY` (`PRODUCT_CATEGORY_ID`),
  CONSTRAINT `PROD_FCGAPL_FGRP` FOREIGN KEY (`PRODUCT_FEATURE_GROUP_ID`) REFERENCES `PRODUCT_FEATURE_GROUP` (`PRODUCT_FEATURE_GROUP_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PRODUCT_FEATURE_DATA_RESOURCE`
--

DROP TABLE IF EXISTS `PRODUCT_FEATURE_DATA_RESOURCE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_FEATURE_DATA_RESOURCE` (
  `DATA_RESOURCE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_FEATURE_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 (`DATA_RESOURCE_ID`,`PRODUCT_FEATURE_ID`),
  KEY `PFEAT_DR_DATRES` (`DATA_RESOURCE_ID`),
  KEY `PFEAT_DR_FEATURE` (`PRODUCT_FEATURE_ID`),
  CONSTRAINT `PFEAT_DR_DATRES` FOREIGN KEY (`DATA_RESOURCE_ID`) REFERENCES `DATA_RESOURCE` (`DATA_RESOURCE_ID`),
  CONSTRAINT `PFEAT_DR_FEATURE` FOREIGN KEY (`PRODUCT_FEATURE_ID`) REFERENCES `PRODUCT_FEATURE` (`PRODUCT_FEATURE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PRODUCT_FEATURE_GROUP`
--

DROP TABLE IF EXISTS `PRODUCT_FEATURE_GROUP`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_FEATURE_GROUP` (
  `PRODUCT_FEATURE_GROUP_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 (`PRODUCT_FEATURE_GROUP_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PRODUCT_FEATURE_GROUP_APPL`
--

DROP TABLE IF EXISTS `PRODUCT_FEATURE_GROUP_APPL`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_FEATURE_GROUP_APPL` (
  `PRODUCT_FEATURE_GROUP_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_FEATURE_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 (`PRODUCT_FEATURE_GROUP_ID`,`PRODUCT_FEATURE_ID`,`FROM_DATE`),
  KEY `PROD_FGAPP_PRODUCT` (`PRODUCT_FEATURE_GROUP_ID`),
  KEY `PROD_FGAPP_FEATURE` (`PRODUCT_FEATURE_ID`),
  CONSTRAINT `PROD_FGAPP_FEATURE` FOREIGN KEY (`PRODUCT_FEATURE_ID`) REFERENCES `PRODUCT_FEATURE` (`PRODUCT_FEATURE_ID`),
  CONSTRAINT `PROD_FGAPP_PRODUCT` FOREIGN KEY (`PRODUCT_FEATURE_GROUP_ID`) REFERENCES `PRODUCT_FEATURE_GROUP` (`PRODUCT_FEATURE_GROUP_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PRODUCT_FEATURE_IACTN`
--

DROP TABLE IF EXISTS `PRODUCT_FEATURE_IACTN`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_FEATURE_IACTN` (
  `PRODUCT_FEATURE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_FEATURE_ID_TO` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_FEATURE_IACTN_TYPE_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 (`PRODUCT_FEATURE_ID`,`PRODUCT_FEATURE_ID_TO`),
  KEY `PROD_FICTN_TYPE` (`PRODUCT_FEATURE_IACTN_TYPE_ID`),
  KEY `PROD_FICTN_MFEAT` (`PRODUCT_FEATURE_ID`),
  KEY `PROD_FICTN_AFEAT` (`PRODUCT_FEATURE_ID_TO`),
  CONSTRAINT `PROD_FICTN_AFEAT` FOREIGN KEY (`PRODUCT_FEATURE_ID_TO`) REFERENCES `PRODUCT_FEATURE` (`PRODUCT_FEATURE_ID`),
  CONSTRAINT `PROD_FICTN_MFEAT` FOREIGN KEY (`PRODUCT_FEATURE_ID`) REFERENCES `PRODUCT_FEATURE` (`PRODUCT_FEATURE_ID`),
  CONSTRAINT `PROD_FICTN_TYPE` FOREIGN KEY (`PRODUCT_FEATURE_IACTN_TYPE_ID`) REFERENCES `PRODUCT_FEATURE_IACTN_TYPE` (`PRODUCT_FEATURE_IACTN_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PRODUCT_FEATURE_IACTN_TYPE`
--

DROP TABLE IF EXISTS `PRODUCT_FEATURE_IACTN_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_FEATURE_IACTN_TYPE` (
  `PRODUCT_FEATURE_IACTN_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 (`PRODUCT_FEATURE_IACTN_TYPE_ID`),
  KEY `PROD_FICTN_TYPPAR` (`PARENT_TYPE_ID`),
  CONSTRAINT `PROD_FICTN_TYPPAR` FOREIGN KEY (`PARENT_TYPE_ID`) REFERENCES `PRODUCT_FEATURE_IACTN_TYPE` (`PRODUCT_FEATURE_IACTN_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PRODUCT_FEATURE_PRICE`
--

DROP TABLE IF EXISTS `PRODUCT_FEATURE_PRICE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_FEATURE_PRICE` (
  `PRODUCT_FEATURE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_PRICE_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CURRENCY_UOM_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FROM_DATE` datetime NOT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `PRICE` decimal(18,3) 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 (`PRODUCT_FEATURE_ID`,`PRODUCT_PRICE_TYPE_ID`,`CURRENCY_UOM_ID`,`FROM_DATE`),
  KEY `PROD_F_PRICE_TYPE` (`PRODUCT_PRICE_TYPE_ID`),
  KEY `PROD_F_PRICE_CUOM` (`CURRENCY_UOM_ID`),
  KEY `PROD_F_PRICE_CBUL` (`CREATED_BY_USER_LOGIN`),
  KEY `PROD_F_PRICE_LMBUL` (`LAST_MODIFIED_BY_USER_LOGIN`),
  CONSTRAINT `PROD_F_PRICE_CBUL` FOREIGN KEY (`CREATED_BY_USER_LOGIN`) REFERENCES `USER_LOGIN` (`USER_LOGIN_ID`),
  CONSTRAINT `PROD_F_PRICE_CUOM` FOREIGN KEY (`CURRENCY_UOM_ID`) REFERENCES `UOM` (`UOM_ID`),
  CONSTRAINT `PROD_F_PRICE_LMBUL` FOREIGN KEY (`LAST_MODIFIED_BY_USER_LOGIN`) REFERENCES `USER_LOGIN` (`USER_LOGIN_ID`),
  CONSTRAINT `PROD_F_PRICE_TYPE` FOREIGN KEY (`PRODUCT_PRICE_TYPE_ID`) REFERENCES `PRODUCT_PRICE_TYPE` (`PRODUCT_PRICE_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PRODUCT_FEATURE_TYPE`
--

DROP TABLE IF EXISTS `PRODUCT_FEATURE_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_FEATURE_TYPE` (
  `PRODUCT_FEATURE_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 (`PRODUCT_FEATURE_TYPE_ID`),
  KEY `PROD_FEAT_TYPPAR` (`PARENT_TYPE_ID`),
  CONSTRAINT `PROD_FEAT_TYPPAR` FOREIGN KEY (`PARENT_TYPE_ID`) REFERENCES `PRODUCT_FEATURE_TYPE` (`PRODUCT_FEATURE_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PRODUCT_GEO`
--

DROP TABLE IF EXISTS `PRODUCT_GEO`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_GEO` (
  `PRODUCT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `GEO_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_GEO_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 (`PRODUCT_ID`,`GEO_ID`),
  KEY `PRDGEO_PRODUCT` (`PRODUCT_ID`),
  KEY `PRDGEO_GEO` (`GEO_ID`),
  KEY `PRDGEO_ENUM` (`PRODUCT_GEO_ENUM_ID`),
  CONSTRAINT `PRDGEO_ENUM` FOREIGN KEY (`PRODUCT_GEO_ENUM_ID`) REFERENCES `ENUMERATION` (`ENUM_ID`),
  CONSTRAINT `PRDGEO_GEO` FOREIGN KEY (`GEO_ID`) REFERENCES `GEO` (`GEO_ID`),
  CONSTRAINT `PRDGEO_PRODUCT` 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 `PRODUCT_GL_ACCOUNT`
--

DROP TABLE IF EXISTS `PRODUCT_GL_ACCOUNT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_GL_ACCOUNT` (
  `PRODUCT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ORGANIZATION_PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `GL_ACCOUNT_TYPE_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 (`PRODUCT_ID`,`ORGANIZATION_PARTY_ID`,`GL_ACCOUNT_TYPE_ID`),
  KEY `PROD_GLACT_PROD` (`PRODUCT_ID`),
  KEY `PROD_GLACT_PARTY` (`ORGANIZATION_PARTY_ID`),
  KEY `PROD_GLACT_TYPE` (`GL_ACCOUNT_TYPE_ID`),
  KEY `PROD_GLACT_GLACT` (`GL_ACCOUNT_ID`),
  CONSTRAINT `PROD_GLACT_GLACT` FOREIGN KEY (`GL_ACCOUNT_ID`) REFERENCES `GL_ACCOUNT` (`GL_ACCOUNT_ID`),
  CONSTRAINT `PROD_GLACT_PARTY` FOREIGN KEY (`ORGANIZATION_PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `PROD_GLACT_PROD` FOREIGN KEY (`PRODUCT_ID`) REFERENCES `PRODUCT` (`PRODUCT_ID`),
  CONSTRAINT `PROD_GLACT_TYPE` FOREIGN KEY (`GL_ACCOUNT_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 `PRODUCT_GROUP_ORDER`
--

DROP TABLE IF EXISTS `PRODUCT_GROUP_ORDER`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_GROUP_ORDER` (
  `GROUP_ORDER_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `FROM_DATE` datetime DEFAULT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `STATUS_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `REQ_ORDER_QTY` decimal(18,6) DEFAULT NULL,
  `SOLD_ORDER_QTY` decimal(18,6) DEFAULT NULL,
  `JOB_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 (`GROUP_ORDER_ID`),
  KEY `PROD_GROUP_ORDER` (`PRODUCT_ID`),
  KEY `GROUP_ORDER_STATUS` (`STATUS_ID`),
  KEY `GROUP_ORDER_JOB` (`JOB_ID`),
  CONSTRAINT `GROUP_ORDER_JOB` FOREIGN KEY (`JOB_ID`) REFERENCES `JOB_SANDBOX` (`JOB_ID`),
  CONSTRAINT `GROUP_ORDER_STATUS` FOREIGN KEY (`STATUS_ID`) REFERENCES `STATUS_ITEM` (`STATUS_ID`),
  CONSTRAINT `PROD_GROUP_ORDER` 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 `PRODUCT_KEYWORD`
--

DROP TABLE IF EXISTS `PRODUCT_KEYWORD`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_KEYWORD` (
  `PRODUCT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `KEYWORD` varchar(60) COLLATE latin1_general_cs NOT NULL,
  `RELEVANCY_WEIGHT` 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 (`PRODUCT_ID`,`KEYWORD`),
  KEY `PROD_KWD_PROD` (`PRODUCT_ID`),
  KEY `PRDCT_KWRD_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `PRDCT_KWRD_TXCRTS` (`CREATED_TX_STAMP`),
  KEY `PROD_KWD_KWD` (`KEYWORD`),
  CONSTRAINT `PROD_KWD_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 `PRODUCT_KEYWORD_NEW`
--

DROP TABLE IF EXISTS `PRODUCT_KEYWORD_NEW`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_KEYWORD_NEW` (
  `PRODUCT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `KEYWORD` varchar(60) COLLATE latin1_general_cs NOT NULL,
  `KEYWORD_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `RELEVANCY_WEIGHT` decimal(20,0) 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 (`PRODUCT_ID`,`KEYWORD`,`KEYWORD_TYPE_ID`),
  KEY `PROD_KWD_PROD_NEW` (`PRODUCT_ID`),
  KEY `PROD_KWD_TYPE` (`KEYWORD_TYPE_ID`),
  KEY `PROD_KWD_STTS` (`STATUS_ID`),
  CONSTRAINT `PROD_KWD_PROD_NEW` FOREIGN KEY (`PRODUCT_ID`) REFERENCES `PRODUCT` (`PRODUCT_ID`),
  CONSTRAINT `PROD_KWD_STTS` FOREIGN KEY (`STATUS_ID`) REFERENCES `STATUS_ITEM` (`STATUS_ID`),
  CONSTRAINT `PROD_KWD_TYPE` FOREIGN KEY (`KEYWORD_TYPE_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 `PRODUCT_KEYWORD_RESULT`
--

DROP TABLE IF EXISTS `PRODUCT_KEYWORD_RESULT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_KEYWORD_RESULT` (
  `PRODUCT_KEYWORD_RESULT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `VISIT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PRODUCT_CATEGORY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SEARCH_STRING` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `INTRA_KEYWORD_OPERATOR` varchar(10) COLLATE latin1_general_cs DEFAULT NULL,
  `ANY_PREFIX` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `ANY_SUFFIX` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `REMOVE_STEMS` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `NUM_RESULTS` 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 (`PRODUCT_KEYWORD_RESULT_ID`),
  KEY `PROD_KWDRES_VST` (`VISIT_ID`),
  KEY `PRDT_KWD_RST_TXSTP` (`LAST_UPDATED_TX_STAMP`),
  KEY `PRDT_KWD_RST_TXCRS` (`CREATED_TX_STAMP`),
  CONSTRAINT `PROD_KWDRES_VST` 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 `PRODUCT_MAINT`
--

DROP TABLE IF EXISTS `PRODUCT_MAINT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_MAINT` (
  `PRODUCT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_MAINT_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_MAINT_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `MAINT_NAME` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `MAINT_TEMPLATE_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,
  `REPEAT_COUNT` 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 (`PRODUCT_ID`,`PRODUCT_MAINT_SEQ_ID`),
  KEY `PRODMNT_PROD` (`PRODUCT_ID`),
  KEY `PRODMNT_MNTTYP` (`PRODUCT_MAINT_TYPE_ID`),
  KEY `PRODMNT_TPLHWE` (`MAINT_TEMPLATE_WORK_EFFORT_ID`),
  KEY `PRODMNT_INTUOM` (`INTERVAL_UOM_ID`),
  KEY `PRODMNT_PDMTTYP` (`INTERVAL_METER_TYPE_ID`),
  CONSTRAINT `PRODMNT_INTUOM` FOREIGN KEY (`INTERVAL_UOM_ID`) REFERENCES `UOM` (`UOM_ID`),
  CONSTRAINT `PRODMNT_MNTTYP` FOREIGN KEY (`PRODUCT_MAINT_TYPE_ID`) REFERENCES `PRODUCT_MAINT_TYPE` (`PRODUCT_MAINT_TYPE_ID`),
  CONSTRAINT `PRODMNT_PDMTTYP` FOREIGN KEY (`INTERVAL_METER_TYPE_ID`) REFERENCES `PRODUCT_METER_TYPE` (`PRODUCT_METER_TYPE_ID`),
  CONSTRAINT `PRODMNT_PROD` FOREIGN KEY (`PRODUCT_ID`) REFERENCES `PRODUCT` (`PRODUCT_ID`),
  CONSTRAINT `PRODMNT_TPLHWE` FOREIGN KEY (`MAINT_TEMPLATE_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 `PRODUCT_MAINT_TYPE`
--

DROP TABLE IF EXISTS `PRODUCT_MAINT_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_MAINT_TYPE` (
  `PRODUCT_MAINT_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `PARENT_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 (`PRODUCT_MAINT_TYPE_ID`),
  KEY `PRODMNT_TYPE_PAR` (`PARENT_TYPE_ID`),
  CONSTRAINT `PRODMNT_TYPE_PAR` FOREIGN KEY (`PARENT_TYPE_ID`) REFERENCES `PRODUCT_MAINT_TYPE` (`PRODUCT_MAINT_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PRODUCT_MANUFACTURING_RULE`
--

DROP TABLE IF EXISTS `PRODUCT_MANUFACTURING_RULE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_MANUFACTURING_RULE` (
  `RULE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PRODUCT_ID_FOR` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PRODUCT_ID_IN` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `RULE_SEQ_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `FROM_DATE` datetime DEFAULT NULL,
  `PRODUCT_ID_IN_SUBST` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PRODUCT_FEATURE` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `RULE_OPERATOR` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `QUANTITY` double DEFAULT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs 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 (`RULE_ID`),
  KEY `PRODUCT_PARENT` (`PRODUCT_ID`),
  KEY `PRODUCT_FOR` (`PRODUCT_ID_FOR`),
  KEY `PRODUCT_IN` (`PRODUCT_ID_IN`),
  KEY `PRODUCT_SUBST` (`PRODUCT_ID_IN_SUBST`),
  KEY `PRODUCT_FEAT` (`PRODUCT_FEATURE`),
  CONSTRAINT `PRODUCT_FEAT` FOREIGN KEY (`PRODUCT_FEATURE`) REFERENCES `PRODUCT_FEATURE` (`PRODUCT_FEATURE_ID`),
  CONSTRAINT `PRODUCT_FOR` FOREIGN KEY (`PRODUCT_ID_FOR`) REFERENCES `PRODUCT` (`PRODUCT_ID`),
  CONSTRAINT `PRODUCT_IN` FOREIGN KEY (`PRODUCT_ID_IN`) REFERENCES `PRODUCT` (`PRODUCT_ID`),
  CONSTRAINT `PRODUCT_PARENT` FOREIGN KEY (`PRODUCT_ID`) REFERENCES `PRODUCT` (`PRODUCT_ID`),
  CONSTRAINT `PRODUCT_SUBST` FOREIGN KEY (`PRODUCT_ID_IN_SUBST`) 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 `PRODUCT_METER`
--

DROP TABLE IF EXISTS `PRODUCT_METER`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_METER` (
  `PRODUCT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_METER_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `METER_UOM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `METER_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 (`PRODUCT_ID`,`PRODUCT_METER_TYPE_ID`),
  KEY `PRODMTR_PROD` (`PRODUCT_ID`),
  KEY `PRODMTR_MTRTYP` (`PRODUCT_METER_TYPE_ID`),
  KEY `PRODMTR_MTRUOM` (`METER_UOM_ID`),
  CONSTRAINT `PRODMTR_MTRTYP` FOREIGN KEY (`PRODUCT_METER_TYPE_ID`) REFERENCES `PRODUCT_METER_TYPE` (`PRODUCT_METER_TYPE_ID`),
  CONSTRAINT `PRODMTR_MTRUOM` FOREIGN KEY (`METER_UOM_ID`) REFERENCES `UOM` (`UOM_ID`),
  CONSTRAINT `PRODMTR_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 `PRODUCT_METER_TYPE`
--

DROP TABLE IF EXISTS `PRODUCT_METER_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_METER_TYPE` (
  `PRODUCT_METER_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `DEFAULT_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 (`PRODUCT_METER_TYPE_ID`),
  KEY `PRODMTRTP_DUOM` (`DEFAULT_UOM_ID`),
  CONSTRAINT `PRODMTRTP_DUOM` FOREIGN KEY (`DEFAULT_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 `PRODUCT_ORDER_ITEM`
--

DROP TABLE IF EXISTS `PRODUCT_ORDER_ITEM`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_ORDER_ITEM` (
  `ORDER_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ORDER_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ENGAGEMENT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ENGAGEMENT_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT 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 (`ORDER_ID`,`ORDER_ITEM_SEQ_ID`,`ENGAGEMENT_ID`,`ENGAGEMENT_ITEM_SEQ_ID`),
  KEY `PROD_OITEM_OHDR` (`ORDER_ID`),
  KEY `PROD_OITEM_OITEM` (`ORDER_ID`,`ORDER_ITEM_SEQ_ID`),
  KEY `PROD_OITEM_PROD` (`PRODUCT_ID`),
  KEY `PROD_OITEM_ENOHDR` (`ENGAGEMENT_ID`),
  KEY `PROD_OITEM_ENOITM` (`ENGAGEMENT_ID`,`ENGAGEMENT_ITEM_SEQ_ID`),
  CONSTRAINT `PROD_OITEM_ENOHDR` FOREIGN KEY (`ENGAGEMENT_ID`) REFERENCES `ORDER_HEADER` (`ORDER_ID`),
  CONSTRAINT `PROD_OITEM_ENOITM` FOREIGN KEY (`ENGAGEMENT_ID`, `ENGAGEMENT_ITEM_SEQ_ID`) REFERENCES `ORDER_ITEM` (`ORDER_ID`, `ORDER_ITEM_SEQ_ID`),
  CONSTRAINT `PROD_OITEM_OHDR` FOREIGN KEY (`ORDER_ID`) REFERENCES `ORDER_HEADER` (`ORDER_ID`),
  CONSTRAINT `PROD_OITEM_OITEM` FOREIGN KEY (`ORDER_ID`, `ORDER_ITEM_SEQ_ID`) REFERENCES `ORDER_ITEM` (`ORDER_ID`, `ORDER_ITEM_SEQ_ID`),
  CONSTRAINT `PROD_OITEM_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 `PRODUCT_PAYMENT_METHOD_TYPE`
--

DROP TABLE IF EXISTS `PRODUCT_PAYMENT_METHOD_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_PAYMENT_METHOD_TYPE` (
  `PRODUCT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PAYMENT_METHOD_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_PRICE_PURPOSE_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 (`PRODUCT_ID`,`PAYMENT_METHOD_TYPE_ID`,`PRODUCT_PRICE_PURPOSE_ID`,`FROM_DATE`),
  KEY `PROD_PMT_PROD` (`PRODUCT_ID`),
  KEY `PROD_PMT_PMT` (`PAYMENT_METHOD_TYPE_ID`),
  KEY `PROD_PMT_PPRP` (`PRODUCT_PRICE_PURPOSE_ID`),
  CONSTRAINT `PROD_PMT_PMT` FOREIGN KEY (`PAYMENT_METHOD_TYPE_ID`) REFERENCES `PAYMENT_METHOD_TYPE` (`PAYMENT_METHOD_TYPE_ID`),
  CONSTRAINT `PROD_PMT_PPRP` FOREIGN KEY (`PRODUCT_PRICE_PURPOSE_ID`) REFERENCES `PRODUCT_PRICE_PURPOSE` (`PRODUCT_PRICE_PURPOSE_ID`),
  CONSTRAINT `PROD_PMT_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 `PRODUCT_PRICE`
--

DROP TABLE IF EXISTS `PRODUCT_PRICE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_PRICE` (
  `PRODUCT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_PRICE_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_PRICE_PURPOSE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CURRENCY_UOM_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_STORE_GROUP_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FROM_DATE` datetime NOT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `PRICE` decimal(18,3) DEFAULT NULL,
  `TERM_UOM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `CUSTOM_PRICE_CALC_SERVICE` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PRICE_WITHOUT_TAX` decimal(18,3) DEFAULT NULL,
  `PRICE_WITH_TAX` decimal(18,3) DEFAULT NULL,
  `TAX_AMOUNT` decimal(18,3) DEFAULT NULL,
  `TAX_PERCENTAGE` decimal(18,6) 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_IN_PRICE` 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 (`PRODUCT_ID`,`PRODUCT_PRICE_TYPE_ID`,`PRODUCT_PRICE_PURPOSE_ID`,`CURRENCY_UOM_ID`,`PRODUCT_STORE_GROUP_ID`,`FROM_DATE`),
  KEY `PROD_PRICE_PROD` (`PRODUCT_ID`),
  KEY `PROD_PRICE_TYPE` (`PRODUCT_PRICE_TYPE_ID`),
  KEY `PROD_PRICE_PURP` (`PRODUCT_PRICE_PURPOSE_ID`),
  KEY `PROD_PRICE_CUOM` (`CURRENCY_UOM_ID`),
  KEY `PROD_PRICE_TUOM` (`TERM_UOM_ID`),
  KEY `PROD_PRICE_PSTG` (`PRODUCT_STORE_GROUP_ID`),
  KEY `PROD_PRICE_CMET` (`CUSTOM_PRICE_CALC_SERVICE`),
  KEY `PROD_PRC_TAXPTY` (`TAX_AUTH_PARTY_ID`),
  KEY `PROD_PRC_TAXGEO` (`TAX_AUTH_GEO_ID`),
  KEY `PROD_PRICE_CBUL` (`CREATED_BY_USER_LOGIN`),
  KEY `PROD_PRICE_LMBUL` (`LAST_MODIFIED_BY_USER_LOGIN`),
  CONSTRAINT `PROD_PRC_TAXGEO` FOREIGN KEY (`TAX_AUTH_GEO_ID`) REFERENCES `GEO` (`GEO_ID`),
  CONSTRAINT `PROD_PRC_TAXPTY` FOREIGN KEY (`TAX_AUTH_PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `PROD_PRICE_CBUL` FOREIGN KEY (`CREATED_BY_USER_LOGIN`) REFERENCES `USER_LOGIN` (`USER_LOGIN_ID`),
  CONSTRAINT `PROD_PRICE_CMET` FOREIGN KEY (`CUSTOM_PRICE_CALC_SERVICE`) REFERENCES `CUSTOM_METHOD` (`CUSTOM_METHOD_ID`),
  CONSTRAINT `PROD_PRICE_CUOM` FOREIGN KEY (`CURRENCY_UOM_ID`) REFERENCES `UOM` (`UOM_ID`),
  CONSTRAINT `PROD_PRICE_LMBUL` FOREIGN KEY (`LAST_MODIFIED_BY_USER_LOGIN`) REFERENCES `USER_LOGIN` (`USER_LOGIN_ID`),
  CONSTRAINT `PROD_PRICE_PROD` FOREIGN KEY (`PRODUCT_ID`) REFERENCES `PRODUCT` (`PRODUCT_ID`),
  CONSTRAINT `PROD_PRICE_PSTG` FOREIGN KEY (`PRODUCT_STORE_GROUP_ID`) REFERENCES `PRODUCT_STORE_GROUP` (`PRODUCT_STORE_GROUP_ID`),
  CONSTRAINT `PROD_PRICE_PURP` FOREIGN KEY (`PRODUCT_PRICE_PURPOSE_ID`) REFERENCES `PRODUCT_PRICE_PURPOSE` (`PRODUCT_PRICE_PURPOSE_ID`),
  CONSTRAINT `PROD_PRICE_TUOM` FOREIGN KEY (`TERM_UOM_ID`) REFERENCES `UOM` (`UOM_ID`),
  CONSTRAINT `PROD_PRICE_TYPE` FOREIGN KEY (`PRODUCT_PRICE_TYPE_ID`) REFERENCES `PRODUCT_PRICE_TYPE` (`PRODUCT_PRICE_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PRODUCT_PRICE_ACTION`
--

DROP TABLE IF EXISTS `PRODUCT_PRICE_ACTION`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_PRICE_ACTION` (
  `PRODUCT_PRICE_RULE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_PRICE_ACTION_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_PRICE_ACTION_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `AMOUNT` decimal(18,6) 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 (`PRODUCT_PRICE_RULE_ID`,`PRODUCT_PRICE_ACTION_SEQ_ID`),
  KEY `PROD_PCACT_TYPE` (`PRODUCT_PRICE_ACTION_TYPE_ID`),
  KEY `PROD_PCACT_RL` (`PRODUCT_PRICE_RULE_ID`),
  CONSTRAINT `PROD_PCACT_RL` FOREIGN KEY (`PRODUCT_PRICE_RULE_ID`) REFERENCES `PRODUCT_PRICE_RULE` (`PRODUCT_PRICE_RULE_ID`),
  CONSTRAINT `PROD_PCACT_TYPE` FOREIGN KEY (`PRODUCT_PRICE_ACTION_TYPE_ID`) REFERENCES `PRODUCT_PRICE_ACTION_TYPE` (`PRODUCT_PRICE_ACTION_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PRODUCT_PRICE_ACTION_TYPE`
--

DROP TABLE IF EXISTS `PRODUCT_PRICE_ACTION_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_PRICE_ACTION_TYPE` (
  `PRODUCT_PRICE_ACTION_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 (`PRODUCT_PRICE_ACTION_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PRODUCT_PRICE_AUTO_NOTICE`
--

DROP TABLE IF EXISTS `PRODUCT_PRICE_AUTO_NOTICE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_PRICE_AUTO_NOTICE` (
  `PRODUCT_PRICE_NOTICE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FACILITY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `RUN_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 (`PRODUCT_PRICE_NOTICE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PRODUCT_PRICE_CHANGE`
--

DROP TABLE IF EXISTS `PRODUCT_PRICE_CHANGE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_PRICE_CHANGE` (
  `PRODUCT_PRICE_CHANGE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PRODUCT_PRICE_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PRODUCT_PRICE_PURPOSE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `CURRENCY_UOM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PRODUCT_STORE_GROUP_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `FROM_DATE` datetime DEFAULT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `PRICE` decimal(18,2) DEFAULT NULL,
  `OLD_PRICE` decimal(18,2) DEFAULT NULL,
  `CHANGED_DATE` datetime DEFAULT NULL,
  `CHANGED_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 (`PRODUCT_PRICE_CHANGE_ID`),
  KEY `PROD_PRCHNG_CHUL` (`CHANGED_BY_USER_LOGIN`),
  CONSTRAINT `PROD_PRCHNG_CHUL` FOREIGN KEY (`CHANGED_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 `PRODUCT_PRICE_COND`
--

DROP TABLE IF EXISTS `PRODUCT_PRICE_COND`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_PRICE_COND` (
  `PRODUCT_PRICE_RULE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_PRICE_COND_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `INPUT_PARAM_ENUM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `OPERATOR_ENUM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `COND_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 (`PRODUCT_PRICE_RULE_ID`,`PRODUCT_PRICE_COND_SEQ_ID`),
  KEY `PROD_PCCOND_RULE` (`PRODUCT_PRICE_RULE_ID`),
  KEY `PROD_PCCOND_INENUM` (`INPUT_PARAM_ENUM_ID`),
  KEY `PROD_PCCOND_OPENUM` (`OPERATOR_ENUM_ID`),
  CONSTRAINT `PROD_PCCOND_INENUM` FOREIGN KEY (`INPUT_PARAM_ENUM_ID`) REFERENCES `ENUMERATION` (`ENUM_ID`),
  CONSTRAINT `PROD_PCCOND_OPENUM` FOREIGN KEY (`OPERATOR_ENUM_ID`) REFERENCES `ENUMERATION` (`ENUM_ID`),
  CONSTRAINT `PROD_PCCOND_RULE` 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 `PRODUCT_PRICE_PURPOSE`
--

DROP TABLE IF EXISTS `PRODUCT_PRICE_PURPOSE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_PRICE_PURPOSE` (
  `PRODUCT_PRICE_PURPOSE_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 (`PRODUCT_PRICE_PURPOSE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PRODUCT_PRICE_RULE`
--

DROP TABLE IF EXISTS `PRODUCT_PRICE_RULE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_PRICE_RULE` (
  `PRODUCT_PRICE_RULE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `RULE_NAME` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `IS_SALE` char(1) 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 (`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 `PRODUCT_PRICE_TYPE`
--

DROP TABLE IF EXISTS `PRODUCT_PRICE_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_PRICE_TYPE` (
  `PRODUCT_PRICE_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 (`PRODUCT_PRICE_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PRODUCT_PROMO`
--

DROP TABLE IF EXISTS `PRODUCT_PROMO`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_PROMO` (
  `PRODUCT_PROMO_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PROMO_NAME` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `PROMO_TEXT` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `USER_ENTERED` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `SHOW_TO_CUSTOMER` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `REQUIRE_CODE` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `USE_LIMIT_PER_ORDER` decimal(20,0) DEFAULT NULL,
  `USE_LIMIT_PER_CUSTOMER` decimal(20,0) DEFAULT NULL,
  `USE_LIMIT_PER_PROMOTION` decimal(20,0) DEFAULT NULL,
  `BILLBACK_FACTOR` decimal(18,6) DEFAULT NULL,
  `OVERRIDE_ORG_PARTY_ID` varchar(20) 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 (`PRODUCT_PROMO_ID`),
  KEY `PROD_PRMO_OPA` (`OVERRIDE_ORG_PARTY_ID`),
  KEY `PROD_PRMO_CUL` (`CREATED_BY_USER_LOGIN`),
  KEY `PROD_PRMO_LMCUL` (`LAST_MODIFIED_BY_USER_LOGIN`),
  CONSTRAINT `PROD_PRMO_CUL` FOREIGN KEY (`CREATED_BY_USER_LOGIN`) REFERENCES `USER_LOGIN` (`USER_LOGIN_ID`),
  CONSTRAINT `PROD_PRMO_LMCUL` FOREIGN KEY (`LAST_MODIFIED_BY_USER_LOGIN`) REFERENCES `USER_LOGIN` (`USER_LOGIN_ID`),
  CONSTRAINT `PROD_PRMO_OPA` FOREIGN KEY (`OVERRIDE_ORG_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 `PRODUCT_PROMO_ACTION`
--

DROP TABLE IF EXISTS `PRODUCT_PROMO_ACTION`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_PROMO_ACTION` (
  `PRODUCT_PROMO_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_PROMO_RULE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_PROMO_ACTION_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_PROMO_ACTION_ENUM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ORDER_ADJUSTMENT_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SERVICE_NAME` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `QUANTITY` decimal(18,6) DEFAULT NULL,
  `AMOUNT` decimal(18,6) DEFAULT NULL,
  `PRODUCT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `USE_CART_QUANTITY` 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 (`PRODUCT_PROMO_ID`,`PRODUCT_PROMO_RULE_ID`,`PRODUCT_PROMO_ACTION_SEQ_ID`),
  KEY `PROD_PRACT_ENUM` (`PRODUCT_PROMO_ACTION_ENUM_ID`),
  KEY `PROD_PRACT_PR` (`PRODUCT_PROMO_ID`),
  KEY `PROD_PRACT_RL` (`PRODUCT_PROMO_ID`,`PRODUCT_PROMO_RULE_ID`),
  KEY `PROD_PRACT_OATYPE` (`ORDER_ADJUSTMENT_TYPE_ID`),
  CONSTRAINT `PROD_PRACT_ENUM` FOREIGN KEY (`PRODUCT_PROMO_ACTION_ENUM_ID`) REFERENCES `ENUMERATION` (`ENUM_ID`),
  CONSTRAINT `PROD_PRACT_OATYPE` FOREIGN KEY (`ORDER_ADJUSTMENT_TYPE_ID`) REFERENCES `ORDER_ADJUSTMENT_TYPE` (`ORDER_ADJUSTMENT_TYPE_ID`),
  CONSTRAINT `PROD_PRACT_PR` FOREIGN KEY (`PRODUCT_PROMO_ID`) REFERENCES `PRODUCT_PROMO` (`PRODUCT_PROMO_ID`),
  CONSTRAINT `PROD_PRACT_RL` FOREIGN KEY (`PRODUCT_PROMO_ID`, `PRODUCT_PROMO_RULE_ID`) REFERENCES `PRODUCT_PROMO_RULE` (`PRODUCT_PROMO_ID`, `PRODUCT_PROMO_RULE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PRODUCT_PROMO_CATEGORY`
--

DROP TABLE IF EXISTS `PRODUCT_PROMO_CATEGORY`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_PROMO_CATEGORY` (
  `PRODUCT_PROMO_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_PROMO_RULE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_PROMO_ACTION_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_PROMO_COND_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_CATEGORY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `AND_GROUP_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_PROMO_APPL_ENUM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `INCLUDE_SUB_CATEGORIES` 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 (`PRODUCT_PROMO_ID`,`PRODUCT_PROMO_RULE_ID`,`PRODUCT_PROMO_ACTION_SEQ_ID`,`PRODUCT_PROMO_COND_SEQ_ID`,`PRODUCT_CATEGORY_ID`,`AND_GROUP_ID`),
  KEY `PROD_PRCAT_PROMO` (`PRODUCT_PROMO_ID`),
  KEY `PROD_PRCAT_PRCAT` (`PRODUCT_CATEGORY_ID`),
  KEY `PROD_PRCAT_ENUM` (`PRODUCT_PROMO_APPL_ENUM_ID`),
  CONSTRAINT `PROD_PRCAT_ENUM` FOREIGN KEY (`PRODUCT_PROMO_APPL_ENUM_ID`) REFERENCES `ENUMERATION` (`ENUM_ID`),
  CONSTRAINT `PROD_PRCAT_PRCAT` FOREIGN KEY (`PRODUCT_CATEGORY_ID`) REFERENCES `PRODUCT_CATEGORY` (`PRODUCT_CATEGORY_ID`),
  CONSTRAINT `PROD_PRCAT_PROMO` 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 `PRODUCT_PROMO_CODE`
--

DROP TABLE IF EXISTS `PRODUCT_PROMO_CODE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_PROMO_CODE` (
  `PRODUCT_PROMO_CODE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_PROMO_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `USER_ENTERED` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `REQUIRE_EMAIL_OR_PARTY` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `USE_LIMIT_PER_CODE` decimal(20,0) DEFAULT NULL,
  `USE_LIMIT_PER_CUSTOMER` decimal(20,0) DEFAULT NULL,
  `FROM_DATE` datetime DEFAULT NULL,
  `THRU_DATE` datetime 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 (`PRODUCT_PROMO_CODE_ID`),
  KEY `PROD_PRCOD_PROMO` (`PRODUCT_PROMO_ID`),
  KEY `PROD_PRCOD_CUL` (`CREATED_BY_USER_LOGIN`),
  KEY `PROD_PRCOD_LMCUL` (`LAST_MODIFIED_BY_USER_LOGIN`),
  CONSTRAINT `PROD_PRCOD_CUL` FOREIGN KEY (`CREATED_BY_USER_LOGIN`) REFERENCES `USER_LOGIN` (`USER_LOGIN_ID`),
  CONSTRAINT `PROD_PRCOD_LMCUL` FOREIGN KEY (`LAST_MODIFIED_BY_USER_LOGIN`) REFERENCES `USER_LOGIN` (`USER_LOGIN_ID`),
  CONSTRAINT `PROD_PRCOD_PROMO` 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 `PRODUCT_PROMO_CODE_EMAIL`
--

DROP TABLE IF EXISTS `PRODUCT_PROMO_CODE_EMAIL`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_PROMO_CODE_EMAIL` (
  `PRODUCT_PROMO_CODE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `EMAIL_ADDRESS` varchar(255) 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 (`PRODUCT_PROMO_CODE_ID`,`EMAIL_ADDRESS`),
  KEY `PROD_PRCDE_PCD` (`PRODUCT_PROMO_CODE_ID`),
  CONSTRAINT `PROD_PRCDE_PCD` 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 `PRODUCT_PROMO_CODE_PARTY`
--

DROP TABLE IF EXISTS `PRODUCT_PROMO_CODE_PARTY`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_PROMO_CODE_PARTY` (
  `PRODUCT_PROMO_CODE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARTY_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 (`PRODUCT_PROMO_CODE_ID`,`PARTY_ID`),
  KEY `PROD_PRCDP_PCD` (`PRODUCT_PROMO_CODE_ID`),
  KEY `PROD_PRCDP_PRTY` (`PARTY_ID`),
  CONSTRAINT `PROD_PRCDP_PCD` FOREIGN KEY (`PRODUCT_PROMO_CODE_ID`) REFERENCES `PRODUCT_PROMO_CODE` (`PRODUCT_PROMO_CODE_ID`),
  CONSTRAINT `PROD_PRCDP_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 `PRODUCT_PROMO_COND`
--

DROP TABLE IF EXISTS `PRODUCT_PROMO_COND`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_PROMO_COND` (
  `PRODUCT_PROMO_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_PROMO_RULE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_PROMO_COND_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `INPUT_PARAM_ENUM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `OPERATOR_ENUM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `COND_VALUE` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `OTHER_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 (`PRODUCT_PROMO_ID`,`PRODUCT_PROMO_RULE_ID`,`PRODUCT_PROMO_COND_SEQ_ID`),
  KEY `PROD_PRCOND_PROMO` (`PRODUCT_PROMO_ID`),
  KEY `PROD_PRCOND_RULE` (`PRODUCT_PROMO_ID`,`PRODUCT_PROMO_RULE_ID`),
  KEY `PROD_PRCOND_INENUM` (`INPUT_PARAM_ENUM_ID`),
  KEY `PROD_PRCOND_OPENUM` (`OPERATOR_ENUM_ID`),
  CONSTRAINT `PROD_PRCOND_INENUM` FOREIGN KEY (`INPUT_PARAM_ENUM_ID`) REFERENCES `ENUMERATION` (`ENUM_ID`),
  CONSTRAINT `PROD_PRCOND_OPENUM` FOREIGN KEY (`OPERATOR_ENUM_ID`) REFERENCES `ENUMERATION` (`ENUM_ID`),
  CONSTRAINT `PROD_PRCOND_PROMO` FOREIGN KEY (`PRODUCT_PROMO_ID`) REFERENCES `PRODUCT_PROMO` (`PRODUCT_PROMO_ID`),
  CONSTRAINT `PROD_PRCOND_RULE` FOREIGN KEY (`PRODUCT_PROMO_ID`, `PRODUCT_PROMO_RULE_ID`) REFERENCES `PRODUCT_PROMO_RULE` (`PRODUCT_PROMO_ID`, `PRODUCT_PROMO_RULE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PRODUCT_PROMO_CONTENT`
--

DROP TABLE IF EXISTS `PRODUCT_PROMO_CONTENT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_PROMO_CONTENT` (
  `PRODUCT_PROMO_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CONTENT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_PROMO_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 (`PRODUCT_PROMO_ID`,`CONTENT_ID`,`PRODUCT_PROMO_CONTENT_TYPE_ID`,`FROM_DATE`),
  KEY `PRODPR_CNT_PROD_PR` (`PRODUCT_PROMO_ID`),
  KEY `PRODPR_CNT_CNT` (`CONTENT_ID`),
  KEY `PRODPR_CNT_TYPE` (`PRODUCT_PROMO_CONTENT_TYPE_ID`),
  CONSTRAINT `PRODPR_CNT_CNT` FOREIGN KEY (`CONTENT_ID`) REFERENCES `CONTENT` (`CONTENT_ID`),
  CONSTRAINT `PRODPR_CNT_PROD_PR` FOREIGN KEY (`PRODUCT_PROMO_ID`) REFERENCES `PRODUCT_PROMO` (`PRODUCT_PROMO_ID`),
  CONSTRAINT `PRODPR_CNT_TYPE` FOREIGN KEY (`PRODUCT_PROMO_CONTENT_TYPE_ID`) REFERENCES `PRODUCT_CONTENT_TYPE` (`PRODUCT_CONTENT_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PRODUCT_PROMO_PRODUCT`
--

DROP TABLE IF EXISTS `PRODUCT_PROMO_PRODUCT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_PROMO_PRODUCT` (
  `PRODUCT_PROMO_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_PROMO_RULE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_PROMO_ACTION_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_PROMO_COND_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_PROMO_APPL_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 (`PRODUCT_PROMO_ID`,`PRODUCT_PROMO_RULE_ID`,`PRODUCT_PROMO_ACTION_SEQ_ID`,`PRODUCT_PROMO_COND_SEQ_ID`,`PRODUCT_ID`),
  KEY `PROD_PRPRD_PROMO` (`PRODUCT_PROMO_ID`),
  KEY `PROD_PRPRD_PROD` (`PRODUCT_ID`),
  KEY `PROD_PRPRD_ENUM` (`PRODUCT_PROMO_APPL_ENUM_ID`),
  CONSTRAINT `PROD_PRPRD_ENUM` FOREIGN KEY (`PRODUCT_PROMO_APPL_ENUM_ID`) REFERENCES `ENUMERATION` (`ENUM_ID`),
  CONSTRAINT `PROD_PRPRD_PROD` FOREIGN KEY (`PRODUCT_ID`) REFERENCES `PRODUCT` (`PRODUCT_ID`),
  CONSTRAINT `PROD_PRPRD_PROMO` 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 `PRODUCT_PROMO_RULE`
--

DROP TABLE IF EXISTS `PRODUCT_PROMO_RULE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_PROMO_RULE` (
  `PRODUCT_PROMO_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_PROMO_RULE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `RULE_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 (`PRODUCT_PROMO_ID`,`PRODUCT_PROMO_RULE_ID`),
  KEY `PROD_PRRLE_PROMO` (`PRODUCT_PROMO_ID`),
  CONSTRAINT `PROD_PRRLE_PROMO` 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 */;

--
