-- MySQL dump 10.13  Distrib 5.6.23, for Win64 (x86_64)
--
-- Host: ofbiz.cowj636hhkwu.us-west-2.rds.amazonaws.com    Database: OFBIZ
-- ------------------------------------------------------
-- Server version	5.6.22-log

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Table structure for table `ACCOMMODATION_CLASS`
--

DROP TABLE IF EXISTS `ACCOMMODATION_CLASS`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ACCOMMODATION_CLASS` (
  `ACCOMMODATION_CLASS_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARENT_CLASS_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`ACCOMMODATION_CLASS_ID`),
  KEY `ACCOMM_CLASS_PAR` (`PARENT_CLASS_ID`),
  KEY `ACCMMDN_CLS_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `ACCMMDN_CLS_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `ACCOMM_CLASS_PAR` FOREIGN KEY (`PARENT_CLASS_ID`) REFERENCES `ACCOMMODATION_CLASS` (`ACCOMMODATION_CLASS_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ACCOMMODATION_MAP`
--

DROP TABLE IF EXISTS `ACCOMMODATION_MAP`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ACCOMMODATION_MAP` (
  `ACCOMMODATION_MAP_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ACCOMMODATION_CLASS_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `FIXED_ASSET_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ACCOMMODATION_MAP_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `NUMBER_OF_SPACES` 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 (`ACCOMMODATION_MAP_ID`),
  KEY `ACMD_MAP_CLASS` (`ACCOMMODATION_CLASS_ID`),
  KEY `ACMD_MAP_FA` (`FIXED_ASSET_ID`),
  KEY `ACMD_MAP_TYPE` (`ACCOMMODATION_MAP_TYPE_ID`),
  KEY `ACCMMDTN_MP_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `ACCMMDTN_MP_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `ACMD_MAP_CLASS` FOREIGN KEY (`ACCOMMODATION_CLASS_ID`) REFERENCES `ACCOMMODATION_CLASS` (`ACCOMMODATION_CLASS_ID`),
  CONSTRAINT `ACMD_MAP_FA` FOREIGN KEY (`FIXED_ASSET_ID`) REFERENCES `FIXED_ASSET` (`FIXED_ASSET_ID`),
  CONSTRAINT `ACMD_MAP_TYPE` FOREIGN KEY (`ACCOMMODATION_MAP_TYPE_ID`) REFERENCES `ACCOMMODATION_MAP_TYPE` (`ACCOMMODATION_MAP_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ACCOMMODATION_MAP_TYPE`
--

DROP TABLE IF EXISTS `ACCOMMODATION_MAP_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ACCOMMODATION_MAP_TYPE` (
  `ACCOMMODATION_MAP_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 (`ACCOMMODATION_MAP_TYPE_ID`),
  KEY `ACCMMN_MP_TP_TXSTP` (`LAST_UPDATED_TX_STAMP`),
  KEY `ACCMMN_MP_TP_TXCRS` (`CREATED_TX_STAMP`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ACCOMMODATION_SPOT`
--

DROP TABLE IF EXISTS `ACCOMMODATION_SPOT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ACCOMMODATION_SPOT` (
  `ACCOMMODATION_SPOT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ACCOMMODATION_CLASS_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `FIXED_ASSET_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `NUMBER_OF_SPACES` decimal(20,0) 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 (`ACCOMMODATION_SPOT_ID`),
  KEY `ACCOM_CLASS` (`ACCOMMODATION_CLASS_ID`),
  KEY `SPOT_FA` (`FIXED_ASSET_ID`),
  KEY `ACCMMDN_SPT_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `ACCMMDN_SPT_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `ACCOM_CLASS` FOREIGN KEY (`ACCOMMODATION_CLASS_ID`) REFERENCES `ACCOMMODATION_CLASS` (`ACCOMMODATION_CLASS_ID`),
  CONSTRAINT `SPOT_FA` FOREIGN KEY (`FIXED_ASSET_ID`) REFERENCES `FIXED_ASSET` (`FIXED_ASSET_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ACCTG_TRANS`
--

DROP TABLE IF EXISTS `ACCTG_TRANS`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ACCTG_TRANS` (
  `ACCTG_TRANS_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ACCTG_TRANS_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `TRANSACTION_DATE` datetime DEFAULT NULL,
  `IS_POSTED` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `POSTED_DATE` datetime DEFAULT NULL,
  `SCHEDULED_POSTING_DATE` datetime DEFAULT NULL,
  `GL_JOURNAL_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `GL_FISCAL_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `VOUCHER_REF` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `VOUCHER_DATE` datetime DEFAULT NULL,
  `GROUP_STATUS_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `FIXED_ASSET_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `INVENTORY_ITEM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PHYSICAL_INVENTORY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ROLE_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `INVOICE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PAYMENT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `FIN_ACCOUNT_TRANS_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SHIPMENT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `RECEIPT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `WORK_EFFORT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `THEIR_ACCTG_TRANS_ID` varchar(60) 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 (`ACCTG_TRANS_ID`),
  KEY `ACCTTX_TYPE` (`ACCTG_TRANS_TYPE_ID`),
  KEY `ACCTTX_GLJRNL` (`GL_JOURNAL_ID`),
  KEY `ACCTTX_GLFST` (`GL_FISCAL_TYPE_ID`),
  KEY `ACCTTX_GRPSTTS` (`GROUP_STATUS_ID`),
  KEY `ACCTTX_FASSET` (`FIXED_ASSET_ID`),
  KEY `ACCTTX_PHS_INV` (`PHYSICAL_INVENTORY_ID`),
  KEY `ACCTTX_INVITEM` (`INVENTORY_ITEM_ID`),
  KEY `ACCTTX_INVITEMVAR` (`INVENTORY_ITEM_ID`,`PHYSICAL_INVENTORY_ID`),
  KEY `ACCTTX_PARTY` (`PARTY_ID`),
  KEY `ACCTTX_ROLETYP` (`ROLE_TYPE_ID`),
  KEY `ACCTTX_INVOICE` (`INVOICE_ID`),
  KEY `ACCTTX_PAYMENT` (`PAYMENT_ID`),
  KEY `ACCTTX_FNACTTR` (`FIN_ACCOUNT_TRANS_ID`),
  KEY `ACCTTX_SHIPMENT` (`SHIPMENT_ID`),
  KEY `ACCTTX_SHIPRCPT` (`RECEIPT_ID`),
  KEY `ACCTTX_WEFF` (`WORK_EFFORT_ID`),
  KEY `ACCTG_TRANS_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `ACCTG_TRANS_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `ACCTTX_FASSET` FOREIGN KEY (`FIXED_ASSET_ID`) REFERENCES `FIXED_ASSET` (`FIXED_ASSET_ID`),
  CONSTRAINT `ACCTTX_FNACTTR` FOREIGN KEY (`FIN_ACCOUNT_TRANS_ID`) REFERENCES `FIN_ACCOUNT_TRANS` (`FIN_ACCOUNT_TRANS_ID`),
  CONSTRAINT `ACCTTX_GLFST` FOREIGN KEY (`GL_FISCAL_TYPE_ID`) REFERENCES `GL_FISCAL_TYPE` (`GL_FISCAL_TYPE_ID`),
  CONSTRAINT `ACCTTX_GLJRNL` FOREIGN KEY (`GL_JOURNAL_ID`) REFERENCES `GL_JOURNAL` (`GL_JOURNAL_ID`),
  CONSTRAINT `ACCTTX_GRPSTTS` FOREIGN KEY (`GROUP_STATUS_ID`) REFERENCES `STATUS_ITEM` (`STATUS_ID`),
  CONSTRAINT `ACCTTX_INVITEM` FOREIGN KEY (`INVENTORY_ITEM_ID`) REFERENCES `INVENTORY_ITEM` (`INVENTORY_ITEM_ID`),
  CONSTRAINT `ACCTTX_INVITEMVAR` FOREIGN KEY (`INVENTORY_ITEM_ID`, `PHYSICAL_INVENTORY_ID`) REFERENCES `INVENTORY_ITEM_VARIANCE` (`INVENTORY_ITEM_ID`, `PHYSICAL_INVENTORY_ID`),
  CONSTRAINT `ACCTTX_INVOICE` FOREIGN KEY (`INVOICE_ID`) REFERENCES `INVOICE` (`INVOICE_ID`),
  CONSTRAINT `ACCTTX_PARTY` FOREIGN KEY (`PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `ACCTTX_PAYMENT` FOREIGN KEY (`PAYMENT_ID`) REFERENCES `PAYMENT` (`PAYMENT_ID`),
  CONSTRAINT `ACCTTX_PHS_INV` FOREIGN KEY (`PHYSICAL_INVENTORY_ID`) REFERENCES `PHYSICAL_INVENTORY` (`PHYSICAL_INVENTORY_ID`),
  CONSTRAINT `ACCTTX_ROLETYP` FOREIGN KEY (`ROLE_TYPE_ID`) REFERENCES `ROLE_TYPE` (`ROLE_TYPE_ID`),
  CONSTRAINT `ACCTTX_SHIPMENT` FOREIGN KEY (`SHIPMENT_ID`) REFERENCES `SHIPMENT` (`SHIPMENT_ID`),
  CONSTRAINT `ACCTTX_SHIPRCPT` FOREIGN KEY (`RECEIPT_ID`) REFERENCES `SHIPMENT_RECEIPT` (`RECEIPT_ID`),
  CONSTRAINT `ACCTTX_TYPE` FOREIGN KEY (`ACCTG_TRANS_TYPE_ID`) REFERENCES `ACCTG_TRANS_TYPE` (`ACCTG_TRANS_TYPE_ID`),
  CONSTRAINT `ACCTTX_WEFF` FOREIGN KEY (`WORK_EFFORT_ID`) REFERENCES `WORK_EFFORT` (`WORK_EFFORT_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ACCTG_TRANS_ATTRIBUTE`
--

DROP TABLE IF EXISTS `ACCTG_TRANS_ATTRIBUTE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ACCTG_TRANS_ATTRIBUTE` (
  `ACCTG_TRANS_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ATTR_NAME` varchar(60) COLLATE latin1_general_cs NOT NULL,
  `ATTR_VALUE` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`ACCTG_TRANS_ID`,`ATTR_NAME`),
  KEY `ACCTTX_ATTR` (`ACCTG_TRANS_ID`),
  KEY `ACG_TRS_ATTT_TXSTP` (`LAST_UPDATED_TX_STAMP`),
  KEY `ACG_TRS_ATTT_TXCRS` (`CREATED_TX_STAMP`),
  CONSTRAINT `ACCTTX_ATTR` FOREIGN KEY (`ACCTG_TRANS_ID`) REFERENCES `ACCTG_TRANS` (`ACCTG_TRANS_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ACCTG_TRANS_ENTRY`
--

DROP TABLE IF EXISTS `ACCTG_TRANS_ENTRY`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ACCTG_TRANS_ENTRY` (
  `ACCTG_TRANS_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ACCTG_TRANS_ENTRY_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ACCTG_TRANS_ENTRY_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `VOUCHER_REF` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ROLE_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `THEIR_PARTY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PRODUCT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `THEIR_PRODUCT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `INVENTORY_ITEM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `GL_ACCOUNT_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `GL_ACCOUNT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ORGANIZATION_PARTY_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,
  `ORIG_AMOUNT` decimal(18,2) DEFAULT NULL,
  `ORIG_CURRENCY_UOM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `DEBIT_CREDIT_FLAG` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `DUE_DATE` date DEFAULT NULL,
  `GROUP_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `TAX_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `RECONCILE_STATUS_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SETTLEMENT_TERM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `IS_SUMMARY` 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 (`ACCTG_TRANS_ID`,`ACCTG_TRANS_ENTRY_SEQ_ID`),
  KEY `ACCTTXENT_ATET` (`ACCTG_TRANS_ENTRY_TYPE_ID`),
  KEY `ACCTTXENT_CURNCY` (`CURRENCY_UOM_ID`),
  KEY `ACCTTXENT_OCURNCY` (`ORIG_CURRENCY_UOM_ID`),
  KEY `ACCTTXENT_ACTX` (`ACCTG_TRANS_ID`),
  KEY `ACCTTXENT_INVITEM` (`INVENTORY_ITEM_ID`),
  KEY `ACCTTXENT_PARTY` (`PARTY_ID`),
  KEY `ACCTTXENT_RLTYP` (`ROLE_TYPE_ID`),
  KEY `ACCTTXENT_GLACTT` (`GL_ACCOUNT_TYPE_ID`),
  KEY `ACCTTXENT_GLACT` (`GL_ACCOUNT_ID`),
  KEY `ACCTTXENT_GLACOG` (`GL_ACCOUNT_ID`,`ORGANIZATION_PARTY_ID`),
  KEY `ACCTTXENT_RCSTS` (`RECONCILE_STATUS_ID`),
  KEY `ACCTTXENT_STLEN` (`SETTLEMENT_TERM_ID`),
  KEY `ACCG_TRS_ENR_TXSTP` (`LAST_UPDATED_TX_STAMP`),
  KEY `ACCG_TRS_ENR_TXCRS` (`CREATED_TX_STAMP`),
  CONSTRAINT `ACCTTXENT_ACTX` FOREIGN KEY (`ACCTG_TRANS_ID`) REFERENCES `ACCTG_TRANS` (`ACCTG_TRANS_ID`),
  CONSTRAINT `ACCTTXENT_ATET` FOREIGN KEY (`ACCTG_TRANS_ENTRY_TYPE_ID`) REFERENCES `ACCTG_TRANS_ENTRY_TYPE` (`ACCTG_TRANS_ENTRY_TYPE_ID`),
  CONSTRAINT `ACCTTXENT_CURNCY` FOREIGN KEY (`CURRENCY_UOM_ID`) REFERENCES `UOM` (`UOM_ID`),
  CONSTRAINT `ACCTTXENT_GLACOG` FOREIGN KEY (`GL_ACCOUNT_ID`, `ORGANIZATION_PARTY_ID`) REFERENCES `GL_ACCOUNT_ORGANIZATION` (`GL_ACCOUNT_ID`, `ORGANIZATION_PARTY_ID`),
  CONSTRAINT `ACCTTXENT_GLACT` FOREIGN KEY (`GL_ACCOUNT_ID`) REFERENCES `GL_ACCOUNT` (`GL_ACCOUNT_ID`),
  CONSTRAINT `ACCTTXENT_GLACTT` FOREIGN KEY (`GL_ACCOUNT_TYPE_ID`) REFERENCES `GL_ACCOUNT_TYPE` (`GL_ACCOUNT_TYPE_ID`),
  CONSTRAINT `ACCTTXENT_INVITEM` FOREIGN KEY (`INVENTORY_ITEM_ID`) REFERENCES `INVENTORY_ITEM` (`INVENTORY_ITEM_ID`),
  CONSTRAINT `ACCTTXENT_OCURNCY` FOREIGN KEY (`ORIG_CURRENCY_UOM_ID`) REFERENCES `UOM` (`UOM_ID`),
  CONSTRAINT `ACCTTXENT_PARTY` FOREIGN KEY (`PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `ACCTTXENT_RCSTS` FOREIGN KEY (`RECONCILE_STATUS_ID`) REFERENCES `STATUS_ITEM` (`STATUS_ID`),
  CONSTRAINT `ACCTTXENT_RLTYP` FOREIGN KEY (`ROLE_TYPE_ID`) REFERENCES `ROLE_TYPE` (`ROLE_TYPE_ID`),
  CONSTRAINT `ACCTTXENT_STLEN` FOREIGN KEY (`SETTLEMENT_TERM_ID`) REFERENCES `SETTLEMENT_TERM` (`SETTLEMENT_TERM_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ACCTG_TRANS_ENTRY_TYPE`
--

DROP TABLE IF EXISTS `ACCTG_TRANS_ENTRY_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ACCTG_TRANS_ENTRY_TYPE` (
  `ACCTG_TRANS_ENTRY_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 (`ACCTG_TRANS_ENTRY_TYPE_ID`),
  KEY `ACCTTXE_TYPE_PAR` (`PARENT_TYPE_ID`),
  KEY `ACG_TRS_ENR_TP_TXP` (`LAST_UPDATED_TX_STAMP`),
  KEY `ACG_TRS_ENR_TP_TXS` (`CREATED_TX_STAMP`),
  CONSTRAINT `ACCTTXE_TYPE_PAR` FOREIGN KEY (`PARENT_TYPE_ID`) REFERENCES `ACCTG_TRANS_ENTRY_TYPE` (`ACCTG_TRANS_ENTRY_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ACCTG_TRANS_TYPE`
--

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

--
-- Table structure for table `ACCTG_TRANS_TYPE_ATTR`
--

DROP TABLE IF EXISTS `ACCTG_TRANS_TYPE_ATTR`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ACCTG_TRANS_TYPE_ATTR` (
  `ACCTG_TRANS_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ATTR_NAME` varchar(60) COLLATE latin1_general_cs NOT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`ACCTG_TRANS_TYPE_ID`,`ATTR_NAME`),
  KEY `ACCTTX_TYPE_ATTR` (`ACCTG_TRANS_TYPE_ID`),
  KEY `ACG_TRS_TP_ATR_TXP` (`LAST_UPDATED_TX_STAMP`),
  KEY `ACG_TRS_TP_ATR_TXS` (`CREATED_TX_STAMP`),
  CONSTRAINT `ACCTTX_TYPE_ATTR` FOREIGN KEY (`ACCTG_TRANS_TYPE_ID`) REFERENCES `ACCTG_TRANS_TYPE` (`ACCTG_TRANS_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ADDENDUM`
--

DROP TABLE IF EXISTS `ADDENDUM`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ADDENDUM` (
  `ADDENDUM_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `AGREEMENT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `AGREEMENT_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ADDENDUM_CREATION_DATE` datetime DEFAULT NULL,
  `ADDENDUM_EFFECTIVE_DATE` datetime DEFAULT NULL,
  `ADDENDUM_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 (`ADDENDUM_ID`),
  KEY `ADDNDM_AGRMNT` (`AGREEMENT_ID`),
  KEY `ADDNDM_AGRMNT_ITM` (`AGREEMENT_ID`,`AGREEMENT_ITEM_SEQ_ID`),
  KEY `ADDENDUM_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `ADDENDUM_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `ADDNDM_AGRMNT` FOREIGN KEY (`AGREEMENT_ID`) REFERENCES `AGREEMENT` (`AGREEMENT_ID`),
  CONSTRAINT `ADDNDM_AGRMNT_ITM` FOREIGN KEY (`AGREEMENT_ID`, `AGREEMENT_ITEM_SEQ_ID`) REFERENCES `AGREEMENT_ITEM` (`AGREEMENT_ID`, `AGREEMENT_ITEM_SEQ_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ADDRESS_MATCH_MAP`
--

DROP TABLE IF EXISTS `ADDRESS_MATCH_MAP`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ADDRESS_MATCH_MAP` (
  `MAP_KEY` varchar(250) COLLATE latin1_general_cs NOT NULL,
  `MAP_VALUE` varchar(250) COLLATE latin1_general_cs NOT 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 (`MAP_KEY`,`MAP_VALUE`),
  KEY `ADDRS_MTH_MP_TXSTP` (`LAST_UPDATED_TX_STAMP`),
  KEY `ADDRS_MTH_MP_TXCRS` (`CREATED_TX_STAMP`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `AFFILIATE`
--

DROP TABLE IF EXISTS `AFFILIATE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `AFFILIATE` (
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `AFFILIATE_NAME` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `AFFILIATE_DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `YEAR_ESTABLISHED` varchar(10) COLLATE latin1_general_cs DEFAULT NULL,
  `SITE_TYPE` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `SITE_PAGE_VIEWS` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `SITE_VISITORS` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `DATE_TIME_CREATED` datetime DEFAULT NULL,
  `DATE_TIME_APPROVED` 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`),
  KEY `AFFILIATE_PARTY` (`PARTY_ID`),
  KEY `AFFILIATE_PGRP` (`PARTY_ID`),
  KEY `AFFILIATE_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `AFFILIATE_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `AFFILIATE_PARTY` FOREIGN KEY (`PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `AFFILIATE_PGRP` FOREIGN KEY (`PARTY_ID`) REFERENCES `PARTY_GROUP` (`PARTY_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `AGREEMENT`
--

DROP TABLE IF EXISTS `AGREEMENT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `AGREEMENT` (
  `AGREEMENT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_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_FROM` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ROLE_TYPE_ID_TO` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `AGREEMENT_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `AGREEMENT_DATE` datetime DEFAULT NULL,
  `FROM_DATE` datetime DEFAULT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `TEXT_DATA` 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 (`AGREEMENT_ID`),
  KEY `AGRMNT_PRODUCT` (`PRODUCT_ID`),
  KEY `AGRMNT_FPRTYRLE` (`PARTY_ID_FROM`,`ROLE_TYPE_ID_FROM`),
  KEY `AGRMNT_TPRTYRLE` (`PARTY_ID_TO`,`ROLE_TYPE_ID_TO`),
  KEY `AGRMNT_TYPE` (`AGREEMENT_TYPE_ID`),
  KEY `AGREEMENT_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `AGREEMENT_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `AGRMNT_FPRTYRLE` FOREIGN KEY (`PARTY_ID_FROM`, `ROLE_TYPE_ID_FROM`) REFERENCES `PARTY_ROLE` (`PARTY_ID`, `ROLE_TYPE_ID`),
  CONSTRAINT `AGRMNT_PRODUCT` FOREIGN KEY (`PRODUCT_ID`) REFERENCES `PRODUCT` (`PRODUCT_ID`),
  CONSTRAINT `AGRMNT_TPRTYRLE` FOREIGN KEY (`PARTY_ID_TO`, `ROLE_TYPE_ID_TO`) REFERENCES `PARTY_ROLE` (`PARTY_ID`, `ROLE_TYPE_ID`),
  CONSTRAINT `AGRMNT_TYPE` FOREIGN KEY (`AGREEMENT_TYPE_ID`) REFERENCES `AGREEMENT_TYPE` (`AGREEMENT_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `AGREEMENT_ATTRIBUTE`
--

DROP TABLE IF EXISTS `AGREEMENT_ATTRIBUTE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `AGREEMENT_ATTRIBUTE` (
  `AGREEMENT_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 (`AGREEMENT_ID`,`ATTR_NAME`),
  KEY `AGRMNT_ATTR` (`AGREEMENT_ID`),
  KEY `AGRMT_ATTRT_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `AGRMT_ATTRT_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `AGRMNT_ATTR` FOREIGN KEY (`AGREEMENT_ID`) REFERENCES `AGREEMENT` (`AGREEMENT_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `AGREEMENT_EMPLOYMENT_APPL`
--

DROP TABLE IF EXISTS `AGREEMENT_EMPLOYMENT_APPL`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `AGREEMENT_EMPLOYMENT_APPL` (
  `AGREEMENT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `AGREEMENT_ITEM_SEQ_ID` 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,
  `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,
  `AGREEMENT_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 (`AGREEMENT_ID`,`AGREEMENT_ITEM_SEQ_ID`,`PARTY_ID_TO`,`PARTY_ID_FROM`,`ROLE_TYPE_ID_TO`,`ROLE_TYPE_ID_FROM`,`FROM_DATE`),
  KEY `AGRMNT_EMPL_APPL` (`ROLE_TYPE_ID_FROM`,`ROLE_TYPE_ID_TO`,`PARTY_ID_FROM`,`PARTY_ID_TO`,`FROM_DATE`),
  KEY `AGRMNT_EMPL_AITM` (`AGREEMENT_ID`,`AGREEMENT_ITEM_SEQ_ID`),
  KEY `AGRT_EMPT_APL_TXSP` (`LAST_UPDATED_TX_STAMP`),
  KEY `AGRT_EMPT_APL_TXCS` (`CREATED_TX_STAMP`),
  CONSTRAINT `AGRMNT_EMPL_AITM` FOREIGN KEY (`AGREEMENT_ID`, `AGREEMENT_ITEM_SEQ_ID`) REFERENCES `AGREEMENT_ITEM` (`AGREEMENT_ID`, `AGREEMENT_ITEM_SEQ_ID`),
  CONSTRAINT `AGRMNT_EMPL_APPL` 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`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `AGREEMENT_FACILITY_APPL`
--

DROP TABLE IF EXISTS `AGREEMENT_FACILITY_APPL`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `AGREEMENT_FACILITY_APPL` (
  `AGREEMENT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `AGREEMENT_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FACILITY_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 (`AGREEMENT_ID`,`AGREEMENT_ITEM_SEQ_ID`,`FACILITY_ID`),
  KEY `AGRMNT_FACLT_AITM` (`AGREEMENT_ID`,`AGREEMENT_ITEM_SEQ_ID`),
  KEY `AGRMNT_FACLT_PRD` (`FACILITY_ID`),
  KEY `AGRT_FCT_APL_TXSTP` (`LAST_UPDATED_TX_STAMP`),
  KEY `AGRT_FCT_APL_TXCRS` (`CREATED_TX_STAMP`),
  CONSTRAINT `AGRMNT_FACLT_AITM` FOREIGN KEY (`AGREEMENT_ID`, `AGREEMENT_ITEM_SEQ_ID`) REFERENCES `AGREEMENT_ITEM` (`AGREEMENT_ID`, `AGREEMENT_ITEM_SEQ_ID`),
  CONSTRAINT `AGRMNT_FACLT_PRD` FOREIGN KEY (`FACILITY_ID`) REFERENCES `FACILITY` (`FACILITY_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `AGREEMENT_GEOGRAPHICAL_APPLIC`
--

DROP TABLE IF EXISTS `AGREEMENT_GEOGRAPHICAL_APPLIC`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `AGREEMENT_GEOGRAPHICAL_APPLIC` (
  `AGREEMENT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `AGREEMENT_ITEM_SEQ_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 (`AGREEMENT_ID`,`AGREEMENT_ITEM_SEQ_ID`,`GEO_ID`),
  KEY `AGRMNT_GEOAP_AGR` (`AGREEMENT_ID`),
  KEY `AGRMNT_GEOAP_AGRI` (`AGREEMENT_ID`,`AGREEMENT_ITEM_SEQ_ID`),
  KEY `AGRMNT_GEOAP_GEO` (`GEO_ID`),
  KEY `AGRT_GGRL_APC_TXSP` (`LAST_UPDATED_TX_STAMP`),
  KEY `AGRT_GGRL_APC_TXCS` (`CREATED_TX_STAMP`),
  CONSTRAINT `AGRMNT_GEOAP_AGR` FOREIGN KEY (`AGREEMENT_ID`) REFERENCES `AGREEMENT` (`AGREEMENT_ID`),
  CONSTRAINT `AGRMNT_GEOAP_AGRI` FOREIGN KEY (`AGREEMENT_ID`, `AGREEMENT_ITEM_SEQ_ID`) REFERENCES `AGREEMENT_ITEM` (`AGREEMENT_ID`, `AGREEMENT_ITEM_SEQ_ID`),
  CONSTRAINT `AGRMNT_GEOAP_GEO` 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 `AGREEMENT_ITEM`
--

DROP TABLE IF EXISTS `AGREEMENT_ITEM`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `AGREEMENT_ITEM` (
  `AGREEMENT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `AGREEMENT_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `AGREEMENT_ITEM_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `CURRENCY_UOM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `AGREEMENT_TEXT` longtext COLLATE latin1_general_cs,
  `AGREEMENT_IMAGE` 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 (`AGREEMENT_ID`,`AGREEMENT_ITEM_SEQ_ID`),
  KEY `AGRMNT_ITEM_AGR` (`AGREEMENT_ID`),
  KEY `AGRMNT_ITEM_TYPE` (`AGREEMENT_ITEM_TYPE_ID`),
  KEY `AGRMNT_ITM_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `AGRMNT_ITM_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `AGRMNT_ITEM_AGR` FOREIGN KEY (`AGREEMENT_ID`) REFERENCES `AGREEMENT` (`AGREEMENT_ID`),
  CONSTRAINT `AGRMNT_ITEM_TYPE` FOREIGN KEY (`AGREEMENT_ITEM_TYPE_ID`) REFERENCES `AGREEMENT_ITEM_TYPE` (`AGREEMENT_ITEM_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `AGREEMENT_ITEM_ATTRIBUTE`
--

DROP TABLE IF EXISTS `AGREEMENT_ITEM_ATTRIBUTE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `AGREEMENT_ITEM_ATTRIBUTE` (
  `AGREEMENT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `AGREEMENT_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ATTR_NAME` varchar(60) COLLATE latin1_general_cs NOT NULL,
  `ATTR_VALUE` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`AGREEMENT_ID`,`AGREEMENT_ITEM_SEQ_ID`,`ATTR_NAME`),
  KEY `AGRMNT_ITEM_ATTR` (`AGREEMENT_ID`,`AGREEMENT_ITEM_SEQ_ID`),
  KEY `AGRT_ITM_ATTT_TXSP` (`LAST_UPDATED_TX_STAMP`),
  KEY `AGRT_ITM_ATTT_TXCS` (`CREATED_TX_STAMP`),
  CONSTRAINT `AGRMNT_ITEM_ATTR` FOREIGN KEY (`AGREEMENT_ID`, `AGREEMENT_ITEM_SEQ_ID`) REFERENCES `AGREEMENT_ITEM` (`AGREEMENT_ID`, `AGREEMENT_ITEM_SEQ_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `AGREEMENT_ITEM_TYPE`
--

DROP TABLE IF EXISTS `AGREEMENT_ITEM_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `AGREEMENT_ITEM_TYPE` (
  `AGREEMENT_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 (`AGREEMENT_ITEM_TYPE_ID`),
  KEY `AGRMNT_TYPEPAR` (`PARENT_TYPE_ID`),
  KEY `AGRMT_ITM_TP_TXSTP` (`LAST_UPDATED_TX_STAMP`),
  KEY `AGRMT_ITM_TP_TXCRS` (`CREATED_TX_STAMP`),
  CONSTRAINT `AGRMNT_TYPEPAR` FOREIGN KEY (`PARENT_TYPE_ID`) REFERENCES `AGREEMENT_ITEM_TYPE` (`AGREEMENT_ITEM_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `AGREEMENT_ITEM_TYPE_ATTR`
--

DROP TABLE IF EXISTS `AGREEMENT_ITEM_TYPE_ATTR`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `AGREEMENT_ITEM_TYPE_ATTR` (
  `AGREEMENT_ITEM_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ATTR_NAME` varchar(60) COLLATE latin1_general_cs NOT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`AGREEMENT_ITEM_TYPE_ID`,`ATTR_NAME`),
  KEY `AGRMNT_ITEM_TYPATR` (`AGREEMENT_ITEM_TYPE_ID`),
  KEY `AGT_ITM_TP_ATR_TXP` (`LAST_UPDATED_TX_STAMP`),
  KEY `AGT_ITM_TP_ATR_TXS` (`CREATED_TX_STAMP`),
  CONSTRAINT `AGRMNT_ITEM_TYPATR` FOREIGN KEY (`AGREEMENT_ITEM_TYPE_ID`) REFERENCES `AGREEMENT_ITEM_TYPE` (`AGREEMENT_ITEM_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `AGREEMENT_PARTY_APPLIC`
--

DROP TABLE IF EXISTS `AGREEMENT_PARTY_APPLIC`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `AGREEMENT_PARTY_APPLIC` (
  `AGREEMENT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `AGREEMENT_ITEM_SEQ_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 (`AGREEMENT_ID`,`AGREEMENT_ITEM_SEQ_ID`,`PARTY_ID`),
  KEY `AGRMNT_PTYA_AGR` (`AGREEMENT_ID`),
  KEY `AGRMNT_PTYA_PTY` (`PARTY_ID`),
  KEY `AGRT_PRT_APC_TXSTP` (`LAST_UPDATED_TX_STAMP`),
  KEY `AGRT_PRT_APC_TXCRS` (`CREATED_TX_STAMP`),
  CONSTRAINT `AGRMNT_PTYA_AGR` FOREIGN KEY (`AGREEMENT_ID`) REFERENCES `AGREEMENT` (`AGREEMENT_ID`),
  CONSTRAINT `AGRMNT_PTYA_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 `AGREEMENT_PRODUCT_APPL`
--

DROP TABLE IF EXISTS `AGREEMENT_PRODUCT_APPL`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `AGREEMENT_PRODUCT_APPL` (
  `AGREEMENT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `AGREEMENT_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRICE` decimal(18,3) DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`AGREEMENT_ID`,`AGREEMENT_ITEM_SEQ_ID`,`PRODUCT_ID`),
  KEY `AGRMNT_PRDA_AITM` (`AGREEMENT_ID`,`AGREEMENT_ITEM_SEQ_ID`),
  KEY `AGRMNT_PRDA_PRD` (`PRODUCT_ID`),
  KEY `AGRT_PRT_APL_TXSTP` (`LAST_UPDATED_TX_STAMP`),
  KEY `AGRT_PRT_APL_TXCRS` (`CREATED_TX_STAMP`),
  CONSTRAINT `AGRMNT_PRDA_AITM` FOREIGN KEY (`AGREEMENT_ID`, `AGREEMENT_ITEM_SEQ_ID`) REFERENCES `AGREEMENT_ITEM` (`AGREEMENT_ID`, `AGREEMENT_ITEM_SEQ_ID`),
  CONSTRAINT `AGRMNT_PRDA_PRD` 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 `AGREEMENT_PROMO_APPL`
--

DROP TABLE IF EXISTS `AGREEMENT_PROMO_APPL`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `AGREEMENT_PROMO_APPL` (
  `AGREEMENT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `AGREEMENT_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_PROMO_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 (`AGREEMENT_ID`,`AGREEMENT_ITEM_SEQ_ID`,`PRODUCT_PROMO_ID`,`FROM_DATE`),
  KEY `AGRMNT_PROM_PRO` (`PRODUCT_PROMO_ID`),
  KEY `AGRMNT_PROM_AITM` (`AGREEMENT_ID`,`AGREEMENT_ITEM_SEQ_ID`),
  KEY `AGRT_PRM_APL_TXSTP` (`LAST_UPDATED_TX_STAMP`),
  KEY `AGRT_PRM_APL_TXCRS` (`CREATED_TX_STAMP`),
  CONSTRAINT `AGRMNT_PROM_AITM` FOREIGN KEY (`AGREEMENT_ID`, `AGREEMENT_ITEM_SEQ_ID`) REFERENCES `AGREEMENT_ITEM` (`AGREEMENT_ID`, `AGREEMENT_ITEM_SEQ_ID`),
  CONSTRAINT `AGRMNT_PROM_PRO` 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 `AGREEMENT_ROLE`
--

DROP TABLE IF EXISTS `AGREEMENT_ROLE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `AGREEMENT_ROLE` (
  `AGREEMENT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ROLE_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`AGREEMENT_ID`,`PARTY_ID`,`ROLE_TYPE_ID`),
  KEY `AGRMNT_ROLE_AGR` (`AGREEMENT_ID`),
  KEY `AGRMNT_ROLE_PTY` (`PARTY_ID`),
  KEY `AGRMNT_ROLE_PRLE` (`PARTY_ID`,`ROLE_TYPE_ID`),
  KEY `AGRMNT_RL_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `AGRMNT_RL_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `AGRMNT_ROLE_AGR` FOREIGN KEY (`AGREEMENT_ID`) REFERENCES `AGREEMENT` (`AGREEMENT_ID`),
  CONSTRAINT `AGRMNT_ROLE_PRLE` FOREIGN KEY (`PARTY_ID`, `ROLE_TYPE_ID`) REFERENCES `PARTY_ROLE` (`PARTY_ID`, `ROLE_TYPE_ID`),
  CONSTRAINT `AGRMNT_ROLE_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 `AGREEMENT_TERM`
--

DROP TABLE IF EXISTS `AGREEMENT_TERM`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `AGREEMENT_TERM` (
  `AGREEMENT_TERM_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `TERM_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `AGREEMENT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `AGREEMENT_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `INVOICE_ITEM_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `FROM_DATE` datetime DEFAULT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `TERM_VALUE` decimal(18,3) DEFAULT NULL,
  `TERM_DAYS` decimal(20,0) DEFAULT NULL,
  `TEXT_VALUE` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `MIN_QUANTITY` double DEFAULT NULL,
  `MAX_QUANTITY` double 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 (`AGREEMENT_TERM_ID`),
  KEY `AGRMNT_TERM_TTYP` (`TERM_TYPE_ID`),
  KEY `AGRMNT_TERM_AGR` (`AGREEMENT_ID`),
  KEY `AGRMNT_TERM_AITM` (`AGREEMENT_ID`,`AGREEMENT_ITEM_SEQ_ID`),
  KEY `AGRMNT_TERM_IIT` (`INVOICE_ITEM_TYPE_ID`),
  KEY `AGRMNT_TRM_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `AGRMNT_TRM_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `AGRMNT_TERM_AGR` FOREIGN KEY (`AGREEMENT_ID`) REFERENCES `AGREEMENT` (`AGREEMENT_ID`),
  CONSTRAINT `AGRMNT_TERM_AITM` FOREIGN KEY (`AGREEMENT_ID`, `AGREEMENT_ITEM_SEQ_ID`) REFERENCES `AGREEMENT_ITEM` (`AGREEMENT_ID`, `AGREEMENT_ITEM_SEQ_ID`),
  CONSTRAINT `AGRMNT_TERM_IIT` FOREIGN KEY (`INVOICE_ITEM_TYPE_ID`) REFERENCES `INVOICE_ITEM_TYPE` (`INVOICE_ITEM_TYPE_ID`),
  CONSTRAINT `AGRMNT_TERM_TTYP` FOREIGN KEY (`TERM_TYPE_ID`) REFERENCES `TERM_TYPE` (`TERM_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `AGREEMENT_TERM_ATTRIBUTE`
--

DROP TABLE IF EXISTS `AGREEMENT_TERM_ATTRIBUTE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `AGREEMENT_TERM_ATTRIBUTE` (
  `AGREEMENT_TERM_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ATTR_NAME` varchar(60) COLLATE latin1_general_cs NOT NULL,
  `ATTR_VALUE` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`AGREEMENT_TERM_ID`,`ATTR_NAME`),
  KEY `AGRMNT_TERM_ATTR` (`AGREEMENT_TERM_ID`),
  KEY `AGRT_TRM_ATTT_TXSP` (`LAST_UPDATED_TX_STAMP`),
  KEY `AGRT_TRM_ATTT_TXCS` (`CREATED_TX_STAMP`),
  CONSTRAINT `AGRMNT_TERM_ATTR` FOREIGN KEY (`AGREEMENT_TERM_ID`) REFERENCES `AGREEMENT_TERM` (`AGREEMENT_TERM_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `AGREEMENT_TYPE`
--

DROP TABLE IF EXISTS `AGREEMENT_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `AGREEMENT_TYPE` (
  `AGREEMENT_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 (`AGREEMENT_TYPE_ID`),
  KEY `AGRMNT_TYPE_PAR` (`PARENT_TYPE_ID`),
  KEY `AGRMNT_TP_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `AGRMNT_TP_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `AGRMNT_TYPE_PAR` FOREIGN KEY (`PARENT_TYPE_ID`) REFERENCES `AGREEMENT_TYPE` (`AGREEMENT_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `AGREEMENT_TYPE_ATTR`
--

DROP TABLE IF EXISTS `AGREEMENT_TYPE_ATTR`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `AGREEMENT_TYPE_ATTR` (
  `AGREEMENT_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 (`AGREEMENT_TYPE_ID`,`ATTR_NAME`),
  KEY `AGRMNT_TYPE_ATTR` (`AGREEMENT_TYPE_ID`),
  KEY `AGRMT_TP_ATR_TXSTP` (`LAST_UPDATED_TX_STAMP`),
  KEY `AGRMT_TP_ATR_TXCRS` (`CREATED_TX_STAMP`),
  CONSTRAINT `AGRMNT_TYPE_ATTR` FOREIGN KEY (`AGREEMENT_TYPE_ID`) REFERENCES `AGREEMENT_TYPE` (`AGREEMENT_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `AGREEMENT_WORKEFFORT_APPL`
--

DROP TABLE IF EXISTS `AGREEMENT_WORKEFFORT_APPL`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `AGREEMENT_WORKEFFORT_APPL` (
  `AGREEMENT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `AGREEMENT_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `WORK_EFFORT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`AGREEMENT_ID`,`AGREEMENT_ITEM_SEQ_ID`,`WORK_EFFORT_ID`),
  KEY `AGRMNT_WEA_AITM` (`AGREEMENT_ID`,`AGREEMENT_ITEM_SEQ_ID`),
  KEY `AGRMNT_WEA_WEFF` (`WORK_EFFORT_ID`),
  KEY `AGRT_WRKT_APL_TXSP` (`LAST_UPDATED_TX_STAMP`),
  KEY `AGRT_WRKT_APL_TXCS` (`CREATED_TX_STAMP`),
  CONSTRAINT `AGRMNT_WEA_AITM` FOREIGN KEY (`AGREEMENT_ID`, `AGREEMENT_ITEM_SEQ_ID`) REFERENCES `AGREEMENT_ITEM` (`AGREEMENT_ID`, `AGREEMENT_ITEM_SEQ_ID`),
  CONSTRAINT `AGRMNT_WEA_WEFF` FOREIGN KEY (`WORK_EFFORT_ID`) REFERENCES `WORK_EFFORT` (`WORK_EFFORT_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `AGREEMENT_WORK_EFFORT_APPLIC`
--

DROP TABLE IF EXISTS `AGREEMENT_WORK_EFFORT_APPLIC`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `AGREEMENT_WORK_EFFORT_APPLIC` (
  `AGREEMENT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `AGREEMENT_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `WORK_EFFORT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`AGREEMENT_ID`,`AGREEMENT_ITEM_SEQ_ID`,`WORK_EFFORT_ID`),
  KEY `AGRMNT_WEA_AGRMNT` (`AGREEMENT_ID`),
  KEY `AGRMNT_WEA_WE` (`WORK_EFFORT_ID`),
  KEY `AGT_WRK_EFT_APC_TP` (`LAST_UPDATED_TX_STAMP`),
  KEY `AGT_WRK_EFT_APC_TS` (`CREATED_TX_STAMP`),
  CONSTRAINT `AGRMNT_WEA_AGRMNT` FOREIGN KEY (`AGREEMENT_ID`) REFERENCES `AGREEMENT` (`AGREEMENT_ID`),
  CONSTRAINT `AGRMNT_WEA_WE` 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 `APPLICATION_SANDBOX`
--

DROP TABLE IF EXISTS `APPLICATION_SANDBOX`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `APPLICATION_SANDBOX` (
  `APPLICATION_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `WORK_EFFORT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ROLE_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `FROM_DATE` datetime DEFAULT NULL,
  `RUNTIME_DATA_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 (`APPLICATION_ID`),
  KEY `APP_SNDBX_WEPA` (`WORK_EFFORT_ID`,`PARTY_ID`,`ROLE_TYPE_ID`,`FROM_DATE`),
  KEY `APP_SNDBX_RNTMDTA` (`RUNTIME_DATA_ID`),
  KEY `APPLCN_SNDX_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `APPLCN_SNDX_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `APP_SNDBX_RNTMDTA` FOREIGN KEY (`RUNTIME_DATA_ID`) REFERENCES `RUNTIME_DATA` (`RUNTIME_DATA_ID`),
  CONSTRAINT `APP_SNDBX_WEPA` FOREIGN KEY (`WORK_EFFORT_ID`, `PARTY_ID`, `ROLE_TYPE_ID`, `FROM_DATE`) REFERENCES `WORK_EFFORT_PARTY_ASSIGNMENT` (`WORK_EFFORT_ID`, `PARTY_ID`, `ROLE_TYPE_ID`, `FROM_DATE`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `AUDIO_DATA_RESOURCE`
--

DROP TABLE IF EXISTS `AUDIO_DATA_RESOURCE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `AUDIO_DATA_RESOURCE` (
  `DATA_RESOURCE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `AUDIO_DATA` longblob,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`DATA_RESOURCE_ID`),
  KEY `DATA_REC_AUDIO` (`DATA_RESOURCE_ID`),
  KEY `AD_DT_RSRC_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `AD_DT_RSRC_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `DATA_REC_AUDIO` 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 `BENEFIT_TYPE`
--

DROP TABLE IF EXISTS `BENEFIT_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `BENEFIT_TYPE` (
  `BENEFIT_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `BENEFIT_NAME` varchar(100) COLLATE latin1_general_cs DEFAULT 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,
  `EMPLOYER_PAID_PERCENTAGE` double DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`BENEFIT_TYPE_ID`),
  KEY `BEN_TYPE_PAR` (`PARENT_TYPE_ID`),
  KEY `BNFT_TP_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `BNFT_TP_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `BEN_TYPE_PAR` FOREIGN KEY (`PARENT_TYPE_ID`) REFERENCES `BENEFIT_TYPE` (`BENEFIT_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `BILLING_ACCOUNT`
--

DROP TABLE IF EXISTS `BILLING_ACCOUNT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `BILLING_ACCOUNT` (
  `BILLING_ACCOUNT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ACCOUNT_LIMIT` decimal(18,2) DEFAULT NULL,
  `ACCOUNT_CURRENCY_UOM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `CONTACT_MECH_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `FROM_DATE` datetime DEFAULT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `EXTERNAL_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 (`BILLING_ACCOUNT_ID`),
  KEY `BILLACCT_CMECH` (`CONTACT_MECH_ID`),
  KEY `BILLACCT_CUOM` (`ACCOUNT_CURRENCY_UOM_ID`),
  KEY `BILLACCT_PADDR` (`CONTACT_MECH_ID`),
  KEY `BLLNG_ACCNT_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `BLLNG_ACCNT_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `BILLACCT_CMECH` FOREIGN KEY (`CONTACT_MECH_ID`) REFERENCES `CONTACT_MECH` (`CONTACT_MECH_ID`),
  CONSTRAINT `BILLACCT_CUOM` FOREIGN KEY (`ACCOUNT_CURRENCY_UOM_ID`) REFERENCES `UOM` (`UOM_ID`),
  CONSTRAINT `BILLACCT_PADDR` FOREIGN KEY (`CONTACT_MECH_ID`) REFERENCES `POSTAL_ADDRESS` (`CONTACT_MECH_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `BILLING_ACCOUNT_ROLE`
--

DROP TABLE IF EXISTS `BILLING_ACCOUNT_ROLE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `BILLING_ACCOUNT_ROLE` (
  `BILLING_ACCOUNT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ROLE_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FROM_DATE` datetime NOT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`BILLING_ACCOUNT_ID`,`PARTY_ID`,`ROLE_TYPE_ID`,`FROM_DATE`),
  KEY `BILLACCT_ROLE` (`BILLING_ACCOUNT_ID`),
  KEY `BILLACCT_RL_PARTY` (`PARTY_ID`),
  KEY `BILLACCT_RL_PTRL` (`PARTY_ID`,`ROLE_TYPE_ID`),
  KEY `BLLG_ACCT_RL_TXSTP` (`LAST_UPDATED_TX_STAMP`),
  KEY `BLLG_ACCT_RL_TXCRS` (`CREATED_TX_STAMP`),
  CONSTRAINT `BILLACCT_RL_PARTY` FOREIGN KEY (`PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `BILLACCT_RL_PTRL` FOREIGN KEY (`PARTY_ID`, `ROLE_TYPE_ID`) REFERENCES `PARTY_ROLE` (`PARTY_ID`, `ROLE_TYPE_ID`),
  CONSTRAINT `BILLACCT_ROLE` FOREIGN KEY (`BILLING_ACCOUNT_ID`) REFERENCES `BILLING_ACCOUNT` (`BILLING_ACCOUNT_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `BILLING_ACCOUNT_TERM`
--

DROP TABLE IF EXISTS `BILLING_ACCOUNT_TERM`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `BILLING_ACCOUNT_TERM` (
  `BILLING_ACCOUNT_TERM_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `BILLING_ACCOUNT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `TERM_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `TERM_VALUE` decimal(18,2) DEFAULT NULL,
  `TERM_DAYS` 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 (`BILLING_ACCOUNT_TERM_ID`),
  KEY `BILLACCT_TRM_UOM` (`UOM_ID`),
  KEY `BILLACCT_TRM_TRM` (`TERM_TYPE_ID`),
  KEY `BILLACCT_TRM_BACT` (`BILLING_ACCOUNT_ID`),
  KEY `BLLG_ACT_TRM_TXSTP` (`LAST_UPDATED_TX_STAMP`),
  KEY `BLLG_ACT_TRM_TXCRS` (`CREATED_TX_STAMP`),
  CONSTRAINT `BILLACCT_TRM_BACT` FOREIGN KEY (`BILLING_ACCOUNT_ID`) REFERENCES `BILLING_ACCOUNT` (`BILLING_ACCOUNT_ID`),
  CONSTRAINT `BILLACCT_TRM_TRM` FOREIGN KEY (`TERM_TYPE_ID`) REFERENCES `TERM_TYPE` (`TERM_TYPE_ID`),
  CONSTRAINT `BILLACCT_TRM_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 `BILLING_ACCOUNT_TERM_ATTR`
--

DROP TABLE IF EXISTS `BILLING_ACCOUNT_TERM_ATTR`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `BILLING_ACCOUNT_TERM_ATTR` (
  `BILLING_ACCOUNT_TERM_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ATTR_NAME` varchar(60) COLLATE latin1_general_cs NOT NULL,
  `ATTR_VALUE` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`BILLING_ACCOUNT_TERM_ID`,`ATTR_NAME`),
  KEY `BILLACCT_TRM_ATTR` (`BILLING_ACCOUNT_TERM_ID`),
  KEY `BLG_ACT_TRM_ATR_TP` (`LAST_UPDATED_TX_STAMP`),
  KEY `BLG_ACT_TRM_ATR_TS` (`CREATED_TX_STAMP`),
  CONSTRAINT `BILLACCT_TRM_ATTR` FOREIGN KEY (`BILLING_ACCOUNT_TERM_ID`) REFERENCES `BILLING_ACCOUNT_TERM` (`BILLING_ACCOUNT_TERM_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `BROWSER_TYPE`
--

DROP TABLE IF EXISTS `BROWSER_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `BROWSER_TYPE` (
  `BROWSER_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `BROWSER_NAME` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `BROWSER_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 (`BROWSER_TYPE_ID`),
  KEY `BRWSR_TP_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `BRWSR_TP_TXCRTS` (`CREATED_TX_STAMP`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `BUDGET`
--

DROP TABLE IF EXISTS `BUDGET`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `BUDGET` (
  `BUDGET_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `BUDGET_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `CUSTOM_TIME_PERIOD_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 (`BUDGET_ID`),
  KEY `BUDGET_BGTTYP` (`BUDGET_TYPE_ID`),
  KEY `BUDGET_CTP` (`CUSTOM_TIME_PERIOD_ID`),
  KEY `BUDGET_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `BUDGET_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `BUDGET_BGTTYP` FOREIGN KEY (`BUDGET_TYPE_ID`) REFERENCES `BUDGET_TYPE` (`BUDGET_TYPE_ID`),
  CONSTRAINT `BUDGET_CTP` FOREIGN KEY (`CUSTOM_TIME_PERIOD_ID`) REFERENCES `CUSTOM_TIME_PERIOD` (`CUSTOM_TIME_PERIOD_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `BUDGET_ATTRIBUTE`
--

DROP TABLE IF EXISTS `BUDGET_ATTRIBUTE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `BUDGET_ATTRIBUTE` (
  `BUDGET_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 (`BUDGET_ID`,`ATTR_NAME`),
  KEY `BUDGET_ATTR_BDGT` (`BUDGET_ID`),
  KEY `BDGT_ATTRBT_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `BDGT_ATTRBT_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `BUDGET_ATTR_BDGT` FOREIGN KEY (`BUDGET_ID`) REFERENCES `BUDGET` (`BUDGET_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `BUDGET_ITEM`
--

DROP TABLE IF EXISTS `BUDGET_ITEM`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `BUDGET_ITEM` (
  `BUDGET_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `BUDGET_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `BUDGET_ITEM_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `AMOUNT` decimal(18,2) DEFAULT NULL,
  `PURPOSE` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `JUSTIFICATION` 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 (`BUDGET_ID`,`BUDGET_ITEM_SEQ_ID`),
  KEY `BDGTITM_TO_BDGT` (`BUDGET_ID`),
  KEY `BUDGET_ITEM_BTYP` (`BUDGET_ITEM_TYPE_ID`),
  KEY `BUDGET_ITEM_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `BUDGET_ITEM_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `BDGTITM_TO_BDGT` FOREIGN KEY (`BUDGET_ID`) REFERENCES `BUDGET` (`BUDGET_ID`),
  CONSTRAINT `BUDGET_ITEM_BTYP` FOREIGN KEY (`BUDGET_ITEM_TYPE_ID`) REFERENCES `BUDGET_ITEM_TYPE` (`BUDGET_ITEM_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `BUDGET_ITEM_ATTRIBUTE`
--

DROP TABLE IF EXISTS `BUDGET_ITEM_ATTRIBUTE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `BUDGET_ITEM_ATTRIBUTE` (
  `BUDGET_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `BUDGET_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ATTR_NAME` varchar(60) COLLATE latin1_general_cs NOT NULL,
  `ATTR_VALUE` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`BUDGET_ID`,`BUDGET_ITEM_SEQ_ID`,`ATTR_NAME`),
  KEY `BUDGET_ITEM_ATTR` (`BUDGET_ID`,`BUDGET_ITEM_SEQ_ID`),
  KEY `BDT_ITM_ATTT_TXSTP` (`LAST_UPDATED_TX_STAMP`),
  KEY `BDT_ITM_ATTT_TXCRS` (`CREATED_TX_STAMP`),
  CONSTRAINT `BUDGET_ITEM_ATTR` FOREIGN KEY (`BUDGET_ID`, `BUDGET_ITEM_SEQ_ID`) REFERENCES `BUDGET_ITEM` (`BUDGET_ID`, `BUDGET_ITEM_SEQ_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `BUDGET_ITEM_TYPE`
--

DROP TABLE IF EXISTS `BUDGET_ITEM_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `BUDGET_ITEM_TYPE` (
  `BUDGET_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 (`BUDGET_ITEM_TYPE_ID`),
  KEY `BUDGET_ITM_TYPPAR` (`PARENT_TYPE_ID`),
  KEY `BDGT_ITM_TP_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `BDGT_ITM_TP_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `BUDGET_ITM_TYPPAR` FOREIGN KEY (`PARENT_TYPE_ID`) REFERENCES `BUDGET_ITEM_TYPE` (`BUDGET_ITEM_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `BUDGET_ITEM_TYPE_ATTR`
--

DROP TABLE IF EXISTS `BUDGET_ITEM_TYPE_ATTR`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `BUDGET_ITEM_TYPE_ATTR` (
  `BUDGET_ITEM_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ATTR_NAME` varchar(60) COLLATE latin1_general_cs NOT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`BUDGET_ITEM_TYPE_ID`,`ATTR_NAME`),
  KEY `BUDGET_ITMTYPATTR` (`BUDGET_ITEM_TYPE_ID`),
  KEY `BDT_ITM_TP_ATR_TXP` (`LAST_UPDATED_TX_STAMP`),
  KEY `BDT_ITM_TP_ATR_TXS` (`CREATED_TX_STAMP`),
  CONSTRAINT `BUDGET_ITMTYPATTR` FOREIGN KEY (`BUDGET_ITEM_TYPE_ID`) REFERENCES `BUDGET_ITEM_TYPE` (`BUDGET_ITEM_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `BUDGET_REVIEW`
--

DROP TABLE IF EXISTS `BUDGET_REVIEW`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `BUDGET_REVIEW` (
  `BUDGET_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `BUDGET_REVIEW_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `BUDGET_REVIEW_RESULT_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `REVIEW_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 (`BUDGET_ID`,`BUDGET_REVIEW_ID`,`PARTY_ID`,`BUDGET_REVIEW_RESULT_TYPE_ID`),
  KEY `BUDGET_RVW_BDGT` (`BUDGET_ID`),
  KEY `BUDGET_RVW_PARTY` (`PARTY_ID`),
  KEY `BUDGET_RVW_RTYPE` (`BUDGET_REVIEW_RESULT_TYPE_ID`),
  KEY `BDGT_RVW_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `BDGT_RVW_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `BUDGET_RVW_BDGT` FOREIGN KEY (`BUDGET_ID`) REFERENCES `BUDGET` (`BUDGET_ID`),
  CONSTRAINT `BUDGET_RVW_PARTY` FOREIGN KEY (`PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `BUDGET_RVW_RTYPE` FOREIGN KEY (`BUDGET_REVIEW_RESULT_TYPE_ID`) REFERENCES `BUDGET_REVIEW_RESULT_TYPE` (`BUDGET_REVIEW_RESULT_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `BUDGET_REVIEW_RESULT_TYPE`
--

DROP TABLE IF EXISTS `BUDGET_REVIEW_RESULT_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `BUDGET_REVIEW_RESULT_TYPE` (
  `BUDGET_REVIEW_RESULT_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `DESCRIPTION` varchar(255) 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 (`BUDGET_REVIEW_RESULT_TYPE_ID`),
  KEY `BDT_RVW_RST_TP_TXP` (`LAST_UPDATED_TX_STAMP`),
  KEY `BDT_RVW_RST_TP_TXS` (`CREATED_TX_STAMP`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `BUDGET_REVISION`
--

DROP TABLE IF EXISTS `BUDGET_REVISION`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `BUDGET_REVISION` (
  `BUDGET_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `REVISION_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `DATE_REVISED` 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 (`BUDGET_ID`,`REVISION_SEQ_ID`),
  KEY `BUDGET_RVSN_BDGT` (`BUDGET_ID`),
  KEY `BDGT_RVSN_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `BDGT_RVSN_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `BUDGET_RVSN_BDGT` FOREIGN KEY (`BUDGET_ID`) REFERENCES `BUDGET` (`BUDGET_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `BUDGET_REVISION_IMPACT`
--

DROP TABLE IF EXISTS `BUDGET_REVISION_IMPACT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `BUDGET_REVISION_IMPACT` (
  `BUDGET_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `BUDGET_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `REVISION_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `REVISED_AMOUNT` decimal(18,2) DEFAULT NULL,
  `ADD_DELETE_FLAG` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `REVISION_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 (`BUDGET_ID`,`BUDGET_ITEM_SEQ_ID`,`REVISION_SEQ_ID`),
  KEY `BUDGET_RNIMP_BDGT` (`BUDGET_ID`),
  KEY `BUDGET_RNIMP_BITM` (`BUDGET_ID`,`BUDGET_ITEM_SEQ_ID`),
  KEY `BUDGET_RNIMP_REV` (`BUDGET_ID`,`REVISION_SEQ_ID`),
  KEY `BDT_RVN_IMPT_TXSTP` (`LAST_UPDATED_TX_STAMP`),
  KEY `BDT_RVN_IMPT_TXCRS` (`CREATED_TX_STAMP`),
  CONSTRAINT `BUDGET_RNIMP_BDGT` FOREIGN KEY (`BUDGET_ID`) REFERENCES `BUDGET` (`BUDGET_ID`),
  CONSTRAINT `BUDGET_RNIMP_BITM` FOREIGN KEY (`BUDGET_ID`, `BUDGET_ITEM_SEQ_ID`) REFERENCES `BUDGET_ITEM` (`BUDGET_ID`, `BUDGET_ITEM_SEQ_ID`),
  CONSTRAINT `BUDGET_RNIMP_REV` FOREIGN KEY (`BUDGET_ID`, `REVISION_SEQ_ID`) REFERENCES `BUDGET_REVISION` (`BUDGET_ID`, `REVISION_SEQ_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `BUDGET_ROLE`
--

DROP TABLE IF EXISTS `BUDGET_ROLE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `BUDGET_ROLE` (
  `BUDGET_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ROLE_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`BUDGET_ID`,`PARTY_ID`,`ROLE_TYPE_ID`),
  KEY `BUDGET_ROLE_BDGT` (`BUDGET_ID`),
  KEY `BUDGET_ROLE_PARTY` (`PARTY_ID`),
  KEY `BUDGET_ROLE_PROLE` (`PARTY_ID`,`ROLE_TYPE_ID`),
  KEY `BUDGET_ROLE_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `BUDGET_ROLE_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `BUDGET_ROLE_BDGT` FOREIGN KEY (`BUDGET_ID`) REFERENCES `BUDGET` (`BUDGET_ID`),
  CONSTRAINT `BUDGET_ROLE_PARTY` FOREIGN KEY (`PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `BUDGET_ROLE_PROLE` FOREIGN KEY (`PARTY_ID`, `ROLE_TYPE_ID`) REFERENCES `PARTY_ROLE` (`PARTY_ID`, `ROLE_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `BUDGET_SCENARIO`
--

DROP TABLE IF EXISTS `BUDGET_SCENARIO`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `BUDGET_SCENARIO` (
  `BUDGET_SCENARIO_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 (`BUDGET_SCENARIO_ID`),
  KEY `BDGT_SCNR_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `BDGT_SCNR_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 `BUDGET_SCENARIO_APPLICATION`
--

DROP TABLE IF EXISTS `BUDGET_SCENARIO_APPLICATION`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `BUDGET_SCENARIO_APPLICATION` (
  `BUDGET_SCENARIO_APPLIC_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `BUDGET_SCENARIO_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `BUDGET_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `BUDGET_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `AMOUNT_CHANGE` decimal(18,2) DEFAULT NULL,
  `PERCENTAGE_CHANGE` 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 (`BUDGET_SCENARIO_APPLIC_ID`,`BUDGET_SCENARIO_ID`),
  KEY `BUDGET_SAPL_BSCN` (`BUDGET_SCENARIO_ID`),
  KEY `BUDGET_SAPL_BDGT` (`BUDGET_ID`),
  KEY `BUDGET_SAPL_BITM` (`BUDGET_ID`,`BUDGET_ITEM_SEQ_ID`),
  KEY `BDT_SCR_APPLN_TXSP` (`LAST_UPDATED_TX_STAMP`),
  KEY `BDT_SCR_APPLN_TXCS` (`CREATED_TX_STAMP`),
  CONSTRAINT `BUDGET_SAPL_BDGT` FOREIGN KEY (`BUDGET_ID`) REFERENCES `BUDGET` (`BUDGET_ID`),
  CONSTRAINT `BUDGET_SAPL_BITM` FOREIGN KEY (`BUDGET_ID`, `BUDGET_ITEM_SEQ_ID`) REFERENCES `BUDGET_ITEM` (`BUDGET_ID`, `BUDGET_ITEM_SEQ_ID`),
  CONSTRAINT `BUDGET_SAPL_BSCN` FOREIGN KEY (`BUDGET_SCENARIO_ID`) REFERENCES `BUDGET_SCENARIO` (`BUDGET_SCENARIO_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `BUDGET_SCENARIO_RULE`
--

DROP TABLE IF EXISTS `BUDGET_SCENARIO_RULE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `BUDGET_SCENARIO_RULE` (
  `BUDGET_SCENARIO_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `BUDGET_ITEM_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `AMOUNT_CHANGE` decimal(18,2) DEFAULT NULL,
  `PERCENTAGE_CHANGE` 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 (`BUDGET_SCENARIO_ID`,`BUDGET_ITEM_TYPE_ID`),
  KEY `BUDGET_SRLE_BSCN` (`BUDGET_SCENARIO_ID`),
  KEY `BUDGET_SRLE_BITP` (`BUDGET_ITEM_TYPE_ID`),
  KEY `BDGT_SCR_RL_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `BDGT_SCR_RL_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `BUDGET_SRLE_BITP` FOREIGN KEY (`BUDGET_ITEM_TYPE_ID`) REFERENCES `BUDGET_ITEM_TYPE` (`BUDGET_ITEM_TYPE_ID`),
  CONSTRAINT `BUDGET_SRLE_BSCN` FOREIGN KEY (`BUDGET_SCENARIO_ID`) REFERENCES `BUDGET_SCENARIO` (`BUDGET_SCENARIO_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `BUDGET_STATUS`
--

DROP TABLE IF EXISTS `BUDGET_STATUS`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `BUDGET_STATUS` (
  `BUDGET_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `STATUS_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `STATUS_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 (`BUDGET_ID`,`STATUS_ID`),
  KEY `BUDGET_STTS_BDGT` (`BUDGET_ID`),
  KEY `BUDGET_STTS_STTS` (`STATUS_ID`),
  KEY `BDGT_STTS_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `BDGT_STTS_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `BUDGET_STTS_BDGT` FOREIGN KEY (`BUDGET_ID`) REFERENCES `BUDGET` (`BUDGET_ID`),
  CONSTRAINT `BUDGET_STTS_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 `BUDGET_TYPE`
--

DROP TABLE IF EXISTS `BUDGET_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `BUDGET_TYPE` (
  `BUDGET_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 (`BUDGET_TYPE_ID`),
  KEY `BUDGET_TYPE_PAR` (`PARENT_TYPE_ID`),
  KEY `BUDGET_TYPE_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `BUDGET_TYPE_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `BUDGET_TYPE_PAR` FOREIGN KEY (`PARENT_TYPE_ID`) REFERENCES `BUDGET_TYPE` (`BUDGET_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `BUDGET_TYPE_ATTR`
--

DROP TABLE IF EXISTS `BUDGET_TYPE_ATTR`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `BUDGET_TYPE_ATTR` (
  `BUDGET_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 (`BUDGET_TYPE_ID`,`ATTR_NAME`),
  KEY `BUDGET_TPATR_BT` (`BUDGET_TYPE_ID`),
  KEY `BDGT_TP_ATR_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `BDGT_TP_ATR_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `BUDGET_TPATR_BT` FOREIGN KEY (`BUDGET_TYPE_ID`) REFERENCES `BUDGET_TYPE` (`BUDGET_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `CARRIER_SHIPMENT_BOX_TYPE`
--

DROP TABLE IF EXISTS `CARRIER_SHIPMENT_BOX_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `CARRIER_SHIPMENT_BOX_TYPE` (
  `SHIPMENT_BOX_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PACKAGING_TYPE_CODE` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `OVERSIZE_CODE` 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 (`SHIPMENT_BOX_TYPE_ID`,`PARTY_ID`),
  KEY `CARR_SHBX_TYPE` (`SHIPMENT_BOX_TYPE_ID`),
  KEY `CARR_SHBX_PARTY` (`PARTY_ID`),
  KEY `CRR_SHT_BX_TP_TXSP` (`LAST_UPDATED_TX_STAMP`),
  KEY `CRR_SHT_BX_TP_TXCS` (`CREATED_TX_STAMP`),
  CONSTRAINT `CARR_SHBX_PARTY` FOREIGN KEY (`PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `CARR_SHBX_TYPE` FOREIGN KEY (`SHIPMENT_BOX_TYPE_ID`) REFERENCES `SHIPMENT_BOX_TYPE` (`SHIPMENT_BOX_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `CARRIER_SHIPMENT_METHOD`
--

DROP TABLE IF EXISTS `CARRIER_SHIPMENT_METHOD`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `CARRIER_SHIPMENT_METHOD` (
  `SHIPMENT_METHOD_TYPE_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,
  `SEQUENCE_NUMBER` decimal(20,0) DEFAULT NULL,
  `CARRIER_SERVICE_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 (`SHIPMENT_METHOD_TYPE_ID`,`PARTY_ID`,`ROLE_TYPE_ID`),
  KEY `CARR_SHMETH_TYPE` (`SHIPMENT_METHOD_TYPE_ID`),
  KEY `CARR_SHMETH_PARTY` (`PARTY_ID`),
  KEY `CARR_SHMETH_PROLE` (`PARTY_ID`,`ROLE_TYPE_ID`),
  KEY `CRR_SHPT_MTD_TXSTP` (`LAST_UPDATED_TX_STAMP`),
  KEY `CRR_SHPT_MTD_TXCRS` (`CREATED_TX_STAMP`),
  CONSTRAINT `CARR_SHMETH_PARTY` FOREIGN KEY (`PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `CARR_SHMETH_PROLE` FOREIGN KEY (`PARTY_ID`, `ROLE_TYPE_ID`) REFERENCES `PARTY_ROLE` (`PARTY_ID`, `ROLE_TYPE_ID`),
  CONSTRAINT `CARR_SHMETH_TYPE` FOREIGN KEY (`SHIPMENT_METHOD_TYPE_ID`) REFERENCES `SHIPMENT_METHOD_TYPE` (`SHIPMENT_METHOD_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `CART_ABANDONED_LINE`
--

DROP TABLE IF EXISTS `CART_ABANDONED_LINE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `CART_ABANDONED_LINE` (
  `VISIT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CART_ABANDONED_LINE_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PROD_CATALOG_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `QUANTITY` decimal(18,6) DEFAULT NULL,
  `RESERV_START` datetime DEFAULT NULL,
  `RESERV_LENGTH` decimal(18,6) DEFAULT NULL,
  `RESERV_PERSONS` decimal(18,6) DEFAULT NULL,
  `UNIT_PRICE` decimal(18,2) 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,
  `TOTAL_WITH_ADJUSTMENTS` decimal(18,2) DEFAULT NULL,
  `WAS_RESERVED` 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 (`VISIT_ID`,`CART_ABANDONED_LINE_SEQ_ID`),
  KEY `CART_ABLN_VST` (`VISIT_ID`),
  KEY `CART_ABLN_PRD` (`PRODUCT_ID`),
  KEY `CART_ABLN_PRDCAT` (`PROD_CATALOG_ID`),
  KEY `CRT_ABNDD_LN_TXSTP` (`LAST_UPDATED_TX_STAMP`),
  KEY `CRT_ABNDD_LN_TXCRS` (`CREATED_TX_STAMP`),
  CONSTRAINT `CART_ABLN_PRD` FOREIGN KEY (`PRODUCT_ID`) REFERENCES `PRODUCT` (`PRODUCT_ID`),
  CONSTRAINT `CART_ABLN_PRDCAT` FOREIGN KEY (`PROD_CATALOG_ID`) REFERENCES `PROD_CATALOG` (`PROD_CATALOG_ID`),
  CONSTRAINT `CART_ABLN_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 `CATALINA_SESSION`
--

DROP TABLE IF EXISTS `CATALINA_SESSION`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `CATALINA_SESSION` (
  `SESSION_ID` varchar(60) COLLATE latin1_general_cs NOT NULL,
  `SESSION_SIZE` decimal(20,0) DEFAULT NULL,
  `SESSION_INFO` longblob,
  `IS_VALID` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `MAX_IDLE` decimal(20,0) DEFAULT NULL,
  `LAST_ACCESSED` 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 (`SESSION_ID`),
  KEY `CTLN_SSSN_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `CTLN_SSSN_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 `CHARACTER_SET`
--

DROP TABLE IF EXISTS `CHARACTER_SET`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `CHARACTER_SET` (
  `CHARACTER_SET_ID` varchar(60) 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 (`CHARACTER_SET_ID`),
  KEY `CHRCTR_ST_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `CHRCTR_ST_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 `COMMUNICATION_EVENT`
--

DROP TABLE IF EXISTS `COMMUNICATION_EVENT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `COMMUNICATION_EVENT` (
  `COMMUNICATION_EVENT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `COMMUNICATION_EVENT_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ORIG_COMM_EVENT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PARENT_COMM_EVENT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `STATUS_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `CONTACT_MECH_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `CONTACT_MECH_ID_FROM` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `CONTACT_MECH_ID_TO` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ROLE_TYPE_ID_FROM` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ROLE_TYPE_ID_TO` 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,
  `ENTRY_DATE` datetime DEFAULT NULL,
  `DATETIME_STARTED` datetime DEFAULT NULL,
  `DATETIME_ENDED` datetime DEFAULT NULL,
  `SUBJECT` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `CONTENT_MIME_TYPE_ID` varchar(250) COLLATE latin1_general_cs DEFAULT NULL,
  `CONTENT` longtext COLLATE latin1_general_cs,
  `NOTE` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `REASON_ENUM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `CONTACT_LIST_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `HEADER_STRING` longtext COLLATE latin1_general_cs,
  `FROM_STRING` longtext COLLATE latin1_general_cs,
  `TO_STRING` longtext COLLATE latin1_general_cs,
  `CC_STRING` longtext COLLATE latin1_general_cs,
  `BCC_STRING` longtext COLLATE latin1_general_cs,
  `MESSAGE_ID` 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 (`COMMUNICATION_EVENT_ID`),
  UNIQUE KEY `COMMEVT_MSG_ID` (`MESSAGE_ID`),
  KEY `COM_EVNT_TYPE` (`COMMUNICATION_EVENT_TYPE_ID`),
  KEY `COM_EVNT_TPTY` (`PARTY_ID_TO`),
  KEY `COM_EVNT_TRTYP` (`ROLE_TYPE_ID_TO`),
  KEY `COM_EVNT_FPTY` (`PARTY_ID_FROM`),
  KEY `COM_EVNT_FRTYP` (`ROLE_TYPE_ID_FROM`),
  KEY `COM_EVNT_STTS` (`STATUS_ID`),
  KEY `COM_EVNT_CMTP` (`CONTACT_MECH_TYPE_ID`),
  KEY `COM_EVNT_FCM` (`CONTACT_MECH_ID_FROM`),
  KEY `COM_EVNT_TCM` (`CONTACT_MECH_ID_TO`),
  KEY `COM_EVNT_CLST` (`CONTACT_LIST_ID`),
  KEY `COM_EVNT_MIMETYPE` (`CONTENT_MIME_TYPE_ID`),
  KEY `COM_EVNT_RESENUM` (`REASON_ENUM_ID`),
  KEY `CMMNCTN_EVT_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `CMMNCTN_EVT_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `COM_EVNT_CLST` FOREIGN KEY (`CONTACT_LIST_ID`) REFERENCES `CONTACT_LIST` (`CONTACT_LIST_ID`),
  CONSTRAINT `COM_EVNT_CMTP` FOREIGN KEY (`CONTACT_MECH_TYPE_ID`) REFERENCES `CONTACT_MECH_TYPE` (`CONTACT_MECH_TYPE_ID`),
  CONSTRAINT `COM_EVNT_FCM` FOREIGN KEY (`CONTACT_MECH_ID_FROM`) REFERENCES `CONTACT_MECH` (`CONTACT_MECH_ID`),
  CONSTRAINT `COM_EVNT_FPTY` FOREIGN KEY (`PARTY_ID_FROM`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `COM_EVNT_FRTYP` FOREIGN KEY (`ROLE_TYPE_ID_FROM`) REFERENCES `ROLE_TYPE` (`ROLE_TYPE_ID`),
  CONSTRAINT `COM_EVNT_MIMETYPE` FOREIGN KEY (`CONTENT_MIME_TYPE_ID`) REFERENCES `MIME_TYPE` (`MIME_TYPE_ID`),
  CONSTRAINT `COM_EVNT_RESENUM` FOREIGN KEY (`REASON_ENUM_ID`) REFERENCES `ENUMERATION` (`ENUM_ID`),
  CONSTRAINT `COM_EVNT_STTS` FOREIGN KEY (`STATUS_ID`) REFERENCES `STATUS_ITEM` (`STATUS_ID`),
  CONSTRAINT `COM_EVNT_TCM` FOREIGN KEY (`CONTACT_MECH_ID_TO`) REFERENCES `CONTACT_MECH` (`CONTACT_MECH_ID`),
  CONSTRAINT `COM_EVNT_TPTY` FOREIGN KEY (`PARTY_ID_TO`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `COM_EVNT_TRTYP` FOREIGN KEY (`ROLE_TYPE_ID_TO`) REFERENCES `ROLE_TYPE` (`ROLE_TYPE_ID`),
  CONSTRAINT `COM_EVNT_TYPE` FOREIGN KEY (`COMMUNICATION_EVENT_TYPE_ID`) REFERENCES `COMMUNICATION_EVENT_TYPE` (`COMMUNICATION_EVENT_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `COMMUNICATION_EVENT_ORDER`
--

DROP TABLE IF EXISTS `COMMUNICATION_EVENT_ORDER`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `COMMUNICATION_EVENT_ORDER` (
  `ORDER_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `COMMUNICATION_EVENT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`ORDER_ID`,`COMMUNICATION_EVENT_ID`),
  KEY `COMEV_ORDER_ORDER` (`ORDER_ID`),
  KEY `COMEV_ORDER_CMEV` (`COMMUNICATION_EVENT_ID`),
  KEY `CMMNN_EVT_ORR_TXSP` (`LAST_UPDATED_TX_STAMP`),
  KEY `CMMNN_EVT_ORR_TXCS` (`CREATED_TX_STAMP`),
  CONSTRAINT `COMEV_ORDER_CMEV` FOREIGN KEY (`COMMUNICATION_EVENT_ID`) REFERENCES `COMMUNICATION_EVENT` (`COMMUNICATION_EVENT_ID`),
  CONSTRAINT `COMEV_ORDER_ORDER` FOREIGN KEY (`ORDER_ID`) REFERENCES `ORDER_HEADER` (`ORDER_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `COMMUNICATION_EVENT_PRODUCT`
--

DROP TABLE IF EXISTS `COMMUNICATION_EVENT_PRODUCT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `COMMUNICATION_EVENT_PRODUCT` (
  `PRODUCT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `COMMUNICATION_EVENT_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_ID`,`COMMUNICATION_EVENT_ID`),
  KEY `COMEV_PROD_PROD` (`PRODUCT_ID`),
  KEY `COMEV_PROD_CMEV` (`COMMUNICATION_EVENT_ID`),
  KEY `CMMNN_EVT_PRT_TXSP` (`LAST_UPDATED_TX_STAMP`),
  KEY `CMMNN_EVT_PRT_TXCS` (`CREATED_TX_STAMP`),
  CONSTRAINT `COMEV_PROD_CMEV` FOREIGN KEY (`COMMUNICATION_EVENT_ID`) REFERENCES `COMMUNICATION_EVENT` (`COMMUNICATION_EVENT_ID`),
  CONSTRAINT `COMEV_PROD_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 `COMMUNICATION_EVENT_PRP_TYP`
--

DROP TABLE IF EXISTS `COMMUNICATION_EVENT_PRP_TYP`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `COMMUNICATION_EVENT_PRP_TYP` (
  `COMMUNICATION_EVENT_PRP_TYP_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 (`COMMUNICATION_EVENT_PRP_TYP_ID`),
  KEY `COM_EVNT_PRP_TYP` (`PARENT_TYPE_ID`),
  KEY `CMN_EVT_PRP_TP_TXP` (`LAST_UPDATED_TX_STAMP`),
  KEY `CMN_EVT_PRP_TP_TXS` (`CREATED_TX_STAMP`),
  CONSTRAINT `COM_EVNT_PRP_TYP` FOREIGN KEY (`PARENT_TYPE_ID`) REFERENCES `COMMUNICATION_EVENT_PRP_TYP` (`COMMUNICATION_EVENT_PRP_TYP_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `COMMUNICATION_EVENT_PURPOSE`
--

DROP TABLE IF EXISTS `COMMUNICATION_EVENT_PURPOSE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `COMMUNICATION_EVENT_PURPOSE` (
  `COMMUNICATION_EVENT_PRP_TYP_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `COMMUNICATION_EVENT_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 (`COMMUNICATION_EVENT_PRP_TYP_ID`,`COMMUNICATION_EVENT_ID`),
  KEY `COM_EVNT_PRP_EVNT` (`COMMUNICATION_EVENT_ID`),
  KEY `COM_EVNT_PRP_TYPE` (`COMMUNICATION_EVENT_PRP_TYP_ID`),
  KEY `CMMNN_EVT_PRS_TXSP` (`LAST_UPDATED_TX_STAMP`),
  KEY `CMMNN_EVT_PRS_TXCS` (`CREATED_TX_STAMP`),
  CONSTRAINT `COM_EVNT_PRP_EVNT` FOREIGN KEY (`COMMUNICATION_EVENT_ID`) REFERENCES `COMMUNICATION_EVENT` (`COMMUNICATION_EVENT_ID`),
  CONSTRAINT `COM_EVNT_PRP_TYPE` FOREIGN KEY (`COMMUNICATION_EVENT_PRP_TYP_ID`) REFERENCES `COMMUNICATION_EVENT_PRP_TYP` (`COMMUNICATION_EVENT_PRP_TYP_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `COMMUNICATION_EVENT_ROLE`
--

DROP TABLE IF EXISTS `COMMUNICATION_EVENT_ROLE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `COMMUNICATION_EVENT_ROLE` (
  `COMMUNICATION_EVENT_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,
  `CONTACT_MECH_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `STATUS_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`COMMUNICATION_EVENT_ID`,`PARTY_ID`,`ROLE_TYPE_ID`),
  KEY `COM_EVRL_CMEV` (`COMMUNICATION_EVENT_ID`),
  KEY `COM_EVRL_PTY` (`PARTY_ID`),
  KEY `COM_EVRL_PRLE` (`PARTY_ID`,`ROLE_TYPE_ID`),
  KEY `COM_EVRL_CMCH` (`CONTACT_MECH_ID`),
  KEY `COM_EVRL_STTS` (`STATUS_ID`),
  KEY `CMMNN_EVT_RL_TXSTP` (`LAST_UPDATED_TX_STAMP`),
  KEY `CMMNN_EVT_RL_TXCRS` (`CREATED_TX_STAMP`),
  CONSTRAINT `COM_EVRL_CMCH` FOREIGN KEY (`CONTACT_MECH_ID`) REFERENCES `CONTACT_MECH` (`CONTACT_MECH_ID`),
  CONSTRAINT `COM_EVRL_CMEV` FOREIGN KEY (`COMMUNICATION_EVENT_ID`) REFERENCES `COMMUNICATION_EVENT` (`COMMUNICATION_EVENT_ID`),
  CONSTRAINT `COM_EVRL_PRLE` FOREIGN KEY (`PARTY_ID`, `ROLE_TYPE_ID`) REFERENCES `PARTY_ROLE` (`PARTY_ID`, `ROLE_TYPE_ID`),
  CONSTRAINT `COM_EVRL_PTY` FOREIGN KEY (`PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `COM_EVRL_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 `COMMUNICATION_EVENT_TYPE`
--

DROP TABLE IF EXISTS `COMMUNICATION_EVENT_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `COMMUNICATION_EVENT_TYPE` (
  `COMMUNICATION_EVENT_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,
  `CONTACT_MECH_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 (`COMMUNICATION_EVENT_TYPE_ID`),
  KEY `COM_EVNT_TYPE_PAR` (`PARENT_TYPE_ID`),
  KEY `COM_EVNT_TYPE_CMT` (`CONTACT_MECH_TYPE_ID`),
  KEY `CMMNN_EVT_TP_TXSTP` (`LAST_UPDATED_TX_STAMP`),
  KEY `CMMNN_EVT_TP_TXCRS` (`CREATED_TX_STAMP`),
  CONSTRAINT `COM_EVNT_TYPE_CMT` FOREIGN KEY (`CONTACT_MECH_TYPE_ID`) REFERENCES `CONTACT_MECH_TYPE` (`CONTACT_MECH_TYPE_ID`),
  CONSTRAINT `COM_EVNT_TYPE_PAR` FOREIGN KEY (`PARENT_TYPE_ID`) REFERENCES `COMMUNICATION_EVENT_TYPE` (`COMMUNICATION_EVENT_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `COMMUNICATION_EVENT_WORK_EFF`
--

DROP TABLE IF EXISTS `COMMUNICATION_EVENT_WORK_EFF`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `COMMUNICATION_EVENT_WORK_EFF` (
  `WORK_EFFORT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `COMMUNICATION_EVENT_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 (`WORK_EFFORT_ID`,`COMMUNICATION_EVENT_ID`),
  KEY `COMEV_WEFF_WEFF` (`WORK_EFFORT_ID`),
  KEY `COMEV_WEFF_CMEV` (`COMMUNICATION_EVENT_ID`),
  KEY `CMN_EVT_WRK_EFF_TP` (`LAST_UPDATED_TX_STAMP`),
  KEY `CMN_EVT_WRK_EFF_TS` (`CREATED_TX_STAMP`),
  CONSTRAINT `COMEV_WEFF_CMEV` FOREIGN KEY (`COMMUNICATION_EVENT_ID`) REFERENCES `COMMUNICATION_EVENT` (`COMMUNICATION_EVENT_ID`),
  CONSTRAINT `COMEV_WEFF_WEFF` FOREIGN KEY (`WORK_EFFORT_ID`) REFERENCES `WORK_EFFORT` (`WORK_EFFORT_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `COMM_CONTENT_ASSOC_TYPE`
--

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

--
-- Table structure for table `COMM_EVENT_CONTENT_ASSOC`
--

DROP TABLE IF EXISTS `COMM_EVENT_CONTENT_ASSOC`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `COMM_EVENT_CONTENT_ASSOC` (
  `CONTENT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `COMMUNICATION_EVENT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `COMM_CONTENT_ASSOC_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,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`CONTENT_ID`,`COMMUNICATION_EVENT_ID`,`FROM_DATE`),
  KEY `COMMEV_CA_FROM` (`CONTENT_ID`),
  KEY `COMMEV_CA_COMMEV` (`COMMUNICATION_EVENT_ID`),
  KEY `COMMEV_CA_TYP` (`COMM_CONTENT_ASSOC_TYPE_ID`),
  KEY `CMM_EVT_CNT_ASC_TP` (`LAST_UPDATED_TX_STAMP`),
  KEY `CMM_EVT_CNT_ASC_TS` (`CREATED_TX_STAMP`),
  CONSTRAINT `COMMEV_CA_COMMEV` FOREIGN KEY (`COMMUNICATION_EVENT_ID`) REFERENCES `COMMUNICATION_EVENT` (`COMMUNICATION_EVENT_ID`),
  CONSTRAINT `COMMEV_CA_FROM` FOREIGN KEY (`CONTENT_ID`) REFERENCES `CONTENT` (`CONTENT_ID`),
  CONSTRAINT `COMMEV_CA_TYP` FOREIGN KEY (`COMM_CONTENT_ASSOC_TYPE_ID`) REFERENCES `COMM_CONTENT_ASSOC_TYPE` (`COMM_CONTENT_ASSOC_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `CONFIG_OPTION_PRODUCT_OPTION`
--

DROP TABLE IF EXISTS `CONFIG_OPTION_PRODUCT_OPTION`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `CONFIG_OPTION_PRODUCT_OPTION` (
  `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,
  `PRODUCT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_OPTION_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_ID`,`CONFIG_ITEM_ID`,`CONFIG_OPTION_ID`,`SEQUENCE_NUM`,`PRODUCT_ID`),
  KEY `PROD_OPTN_CONF` (`CONFIG_ID`,`CONFIG_ITEM_ID`,`CONFIG_OPTION_ID`,`SEQUENCE_NUM`),
  KEY `PROD_OPTN_PROD` (`CONFIG_ITEM_ID`,`CONFIG_OPTION_ID`,`PRODUCT_ID`),
  KEY `CNG_OPN_PRT_OPN_TP` (`LAST_UPDATED_TX_STAMP`),
  KEY `CNG_OPN_PRT_OPN_TS` (`CREATED_TX_STAMP`),
  CONSTRAINT `PROD_OPTN_CONF` FOREIGN KEY (`CONFIG_ID`, `CONFIG_ITEM_ID`, `CONFIG_OPTION_ID`, `SEQUENCE_NUM`) REFERENCES `PRODUCT_CONFIG_CONFIG` (`CONFIG_ID`, `CONFIG_ITEM_ID`, `CONFIG_OPTION_ID`, `SEQUENCE_NUM`),
  CONSTRAINT `PROD_OPTN_PROD` FOREIGN KEY (`CONFIG_ITEM_ID`, `CONFIG_OPTION_ID`, `PRODUCT_ID`) REFERENCES `PRODUCT_CONFIG_PRODUCT` (`CONFIG_ITEM_ID`, `CONFIG_OPTION_ID`, `PRODUCT_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `CONTACT_LIST`
--

DROP TABLE IF EXISTS `CONTACT_LIST`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `CONTACT_LIST` (
  `CONTACT_LIST_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CONTACT_LIST_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `CONTACT_MECH_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `MARKETING_CAMPAIGN_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `CONTACT_LIST_NAME` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `COMMENTS` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `IS_PUBLIC` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `SINGLE_USE` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `OWNER_PARTY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `VERIFY_EMAIL_FROM` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `VERIFY_EMAIL_SCREEN` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `VERIFY_EMAIL_SUBJECT` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `VERIFY_EMAIL_WEB_SITE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `OPT_OUT_SCREEN` varchar(255) COLLATE latin1_general_cs 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 (`CONTACT_LIST_ID`),
  KEY `CNCT_LST_MKCMPN` (`MARKETING_CAMPAIGN_ID`),
  KEY `CNCT_LST_TYP` (`CONTACT_LIST_TYPE_ID`),
  KEY `CNCT_LST_CMCHTP` (`CONTACT_MECH_TYPE_ID`),
  KEY `CNCT_LST_CBUL` (`CREATED_BY_USER_LOGIN`),
  KEY `CNCT_LST_LMUL` (`LAST_MODIFIED_BY_USER_LOGIN`),
  KEY `CNCT_LST_OPTY` (`OWNER_PARTY_ID`),
  KEY `CNTCT_LST_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `CNTCT_LST_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `CNCT_LST_CBUL` FOREIGN KEY (`CREATED_BY_USER_LOGIN`) REFERENCES `USER_LOGIN` (`USER_LOGIN_ID`),
  CONSTRAINT `CNCT_LST_CMCHTP` FOREIGN KEY (`CONTACT_MECH_TYPE_ID`) REFERENCES `CONTACT_MECH_TYPE` (`CONTACT_MECH_TYPE_ID`),
  CONSTRAINT `CNCT_LST_LMUL` FOREIGN KEY (`LAST_MODIFIED_BY_USER_LOGIN`) REFERENCES `USER_LOGIN` (`USER_LOGIN_ID`),
  CONSTRAINT `CNCT_LST_MKCMPN` FOREIGN KEY (`MARKETING_CAMPAIGN_ID`) REFERENCES `MARKETING_CAMPAIGN` (`MARKETING_CAMPAIGN_ID`),
  CONSTRAINT `CNCT_LST_OPTY` FOREIGN KEY (`OWNER_PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `CNCT_LST_TYP` FOREIGN KEY (`CONTACT_LIST_TYPE_ID`) REFERENCES `CONTACT_LIST_TYPE` (`CONTACT_LIST_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `CONTACT_LIST_COMM_STATUS`
--

DROP TABLE IF EXISTS `CONTACT_LIST_COMM_STATUS`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `CONTACT_LIST_COMM_STATUS` (
  `CONTACT_LIST_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `COMMUNICATION_EVENT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CONTACT_MECH_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `MESSAGE_ID` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `STATUS_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`CONTACT_LIST_ID`,`COMMUNICATION_EVENT_ID`,`CONTACT_MECH_ID`),
  UNIQUE KEY `CNTLSTCST_MSG_ID` (`MESSAGE_ID`),
  KEY `CNCT_LST_CST_CL` (`CONTACT_LIST_ID`),
  KEY `CNCT_LST_CST_CE` (`COMMUNICATION_EVENT_ID`),
  KEY `CNCT_LST_CST_CM` (`CONTACT_MECH_ID`),
  KEY `CNCT_LST_CST_PT` (`PARTY_ID`),
  KEY `CNCT_LST_CST_ST` (`STATUS_ID`),
  KEY `CNT_LST_CMM_STS_TP` (`LAST_UPDATED_TX_STAMP`),
  KEY `CNT_LST_CMM_STS_TS` (`CREATED_TX_STAMP`),
  CONSTRAINT `CNCT_LST_CST_CE` FOREIGN KEY (`COMMUNICATION_EVENT_ID`) REFERENCES `COMMUNICATION_EVENT` (`COMMUNICATION_EVENT_ID`),
  CONSTRAINT `CNCT_LST_CST_CL` FOREIGN KEY (`CONTACT_LIST_ID`) REFERENCES `CONTACT_LIST` (`CONTACT_LIST_ID`),
  CONSTRAINT `CNCT_LST_CST_CM` FOREIGN KEY (`CONTACT_MECH_ID`) REFERENCES `CONTACT_MECH` (`CONTACT_MECH_ID`),
  CONSTRAINT `CNCT_LST_CST_PT` FOREIGN KEY (`PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `CNCT_LST_CST_ST` 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 `CONTACT_LIST_PARTY`
--

DROP TABLE IF EXISTS `CONTACT_LIST_PARTY`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `CONTACT_LIST_PARTY` (
  `CONTACT_LIST_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARTY_ID` 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,
  `PREFERRED_CONTACT_MECH_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`CONTACT_LIST_ID`,`PARTY_ID`,`FROM_DATE`),
  KEY `CNCT_LSTPTY_CLST` (`CONTACT_LIST_ID`),
  KEY `CNCT_LSTPTY_PTY` (`PARTY_ID`),
  KEY `CNCT_LSTPTY_STS` (`STATUS_ID`),
  KEY `CNCT_LSTPTY_PCM` (`PREFERRED_CONTACT_MECH_ID`),
  KEY `CNTT_LST_PRT_TXSTP` (`LAST_UPDATED_TX_STAMP`),
  KEY `CNTT_LST_PRT_TXCRS` (`CREATED_TX_STAMP`),
  CONSTRAINT `CNCT_LSTPTY_CLST` FOREIGN KEY (`CONTACT_LIST_ID`) REFERENCES `CONTACT_LIST` (`CONTACT_LIST_ID`),
  CONSTRAINT `CNCT_LSTPTY_PCM` FOREIGN KEY (`PREFERRED_CONTACT_MECH_ID`) REFERENCES `CONTACT_MECH` (`CONTACT_MECH_ID`),
  CONSTRAINT `CNCT_LSTPTY_PTY` FOREIGN KEY (`PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `CNCT_LSTPTY_STS` FOREIGN KEY (`STATUS_ID`) REFERENCES `STATUS_ITEM` (`STATUS_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `CONTACT_LIST_PARTY_STATUS`
--

DROP TABLE IF EXISTS `CONTACT_LIST_PARTY_STATUS`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `CONTACT_LIST_PARTY_STATUS` (
  `CONTACT_LIST_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FROM_DATE` datetime NOT NULL,
  `STATUS_DATE` datetime NOT NULL,
  `STATUS_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SET_BY_USER_LOGIN_ID` varchar(250) COLLATE latin1_general_cs DEFAULT NULL,
  `OPT_IN_VERIFY_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 (`CONTACT_LIST_ID`,`PARTY_ID`,`FROM_DATE`,`STATUS_DATE`),
  KEY `CTLSTPTST_CLP` (`CONTACT_LIST_ID`,`PARTY_ID`,`FROM_DATE`),
  KEY `CNT_LST_PRT_STS_TP` (`LAST_UPDATED_TX_STAMP`),
  KEY `CNT_LST_PRT_STS_TS` (`CREATED_TX_STAMP`),
  CONSTRAINT `CTLSTPTST_CLP` FOREIGN KEY (`CONTACT_LIST_ID`, `PARTY_ID`, `FROM_DATE`) REFERENCES `CONTACT_LIST_PARTY` (`CONTACT_LIST_ID`, `PARTY_ID`, `FROM_DATE`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `CONTACT_LIST_TYPE`
--

DROP TABLE IF EXISTS `CONTACT_LIST_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `CONTACT_LIST_TYPE` (
  `CONTACT_LIST_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 (`CONTACT_LIST_TYPE_ID`),
  KEY `CNTT_LST_TP_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `CNTT_LST_TP_TXCRTS` (`CREATED_TX_STAMP`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `CONTACT_MECH`
--

DROP TABLE IF EXISTS `CONTACT_MECH`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `CONTACT_MECH` (
  `CONTACT_MECH_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CONTACT_MECH_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `INFO_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 (`CONTACT_MECH_ID`),
  KEY `CONT_MECH_TYPE` (`CONTACT_MECH_TYPE_ID`),
  KEY `CNTCT_MCH_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `CNTCT_MCH_TXCRTS` (`CREATED_TX_STAMP`),
  KEY `INFO_STRING_IDX` (`INFO_STRING`),
  CONSTRAINT `CONT_MECH_TYPE` FOREIGN KEY (`CONTACT_MECH_TYPE_ID`) REFERENCES `CONTACT_MECH_TYPE` (`CONTACT_MECH_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `CONTACT_MECH_ATTRIBUTE`
--

DROP TABLE IF EXISTS `CONTACT_MECH_ATTRIBUTE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `CONTACT_MECH_ATTRIBUTE` (
  `CONTACT_MECH_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 (`CONTACT_MECH_ID`,`ATTR_NAME`),
  KEY `CONT_MECH_ATTR` (`CONTACT_MECH_ID`),
  KEY `CNT_MCH_ATTT_TXSTP` (`LAST_UPDATED_TX_STAMP`),
  KEY `CNT_MCH_ATTT_TXCRS` (`CREATED_TX_STAMP`),
  CONSTRAINT `CONT_MECH_ATTR` FOREIGN KEY (`CONTACT_MECH_ID`) REFERENCES `CONTACT_MECH` (`CONTACT_MECH_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `CONTACT_MECH_LINK`
--

DROP TABLE IF EXISTS `CONTACT_MECH_LINK`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `CONTACT_MECH_LINK` (
  `CONTACT_MECH_ID_FROM` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CONTACT_MECH_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 (`CONTACT_MECH_ID_FROM`,`CONTACT_MECH_ID_TO`),
  KEY `CONT_MECH_FCMECH` (`CONTACT_MECH_ID_FROM`),
  KEY `CONT_MECH_TCMECH` (`CONTACT_MECH_ID_TO`),
  KEY `CNTT_MCH_LNK_TXSTP` (`LAST_UPDATED_TX_STAMP`),
  KEY `CNTT_MCH_LNK_TXCRS` (`CREATED_TX_STAMP`),
  CONSTRAINT `CONT_MECH_FCMECH` FOREIGN KEY (`CONTACT_MECH_ID_FROM`) REFERENCES `CONTACT_MECH` (`CONTACT_MECH_ID`),
  CONSTRAINT `CONT_MECH_TCMECH` FOREIGN KEY (`CONTACT_MECH_ID_TO`) REFERENCES `CONTACT_MECH` (`CONTACT_MECH_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `CONTACT_MECH_PURPOSE_TYPE`
--

DROP TABLE IF EXISTS `CONTACT_MECH_PURPOSE_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `CONTACT_MECH_PURPOSE_TYPE` (
  `CONTACT_MECH_PURPOSE_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 (`CONTACT_MECH_PURPOSE_TYPE_ID`),
  KEY `CNT_MCH_PRS_TP_TXP` (`LAST_UPDATED_TX_STAMP`),
  KEY `CNT_MCH_PRS_TP_TXS` (`CREATED_TX_STAMP`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `CONTACT_MECH_TYPE`
--

DROP TABLE IF EXISTS `CONTACT_MECH_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `CONTACT_MECH_TYPE` (
  `CONTACT_MECH_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 (`CONTACT_MECH_TYPE_ID`),
  KEY `CONT_MECH_TYP_PAR` (`PARENT_TYPE_ID`),
  KEY `CNTT_MCH_TP_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `CNTT_MCH_TP_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `CONT_MECH_TYP_PAR` FOREIGN KEY (`PARENT_TYPE_ID`) REFERENCES `CONTACT_MECH_TYPE` (`CONTACT_MECH_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `CONTACT_MECH_TYPE_ATTR`
--

DROP TABLE IF EXISTS `CONTACT_MECH_TYPE_ATTR`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `CONTACT_MECH_TYPE_ATTR` (
  `CONTACT_MECH_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 (`CONTACT_MECH_TYPE_ID`,`ATTR_NAME`),
  KEY `CONT_MECH_TYP_ATR` (`CONTACT_MECH_TYPE_ID`),
  KEY `CNT_MCH_TP_ATR_TXP` (`LAST_UPDATED_TX_STAMP`),
  KEY `CNT_MCH_TP_ATR_TXS` (`CREATED_TX_STAMP`),
  CONSTRAINT `CONT_MECH_TYP_ATR` FOREIGN KEY (`CONTACT_MECH_TYPE_ID`) REFERENCES `CONTACT_MECH_TYPE` (`CONTACT_MECH_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `CONTACT_MECH_TYPE_PURPOSE`
--

DROP TABLE IF EXISTS `CONTACT_MECH_TYPE_PURPOSE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `CONTACT_MECH_TYPE_PURPOSE` (
  `CONTACT_MECH_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CONTACT_MECH_PURPOSE_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 (`CONTACT_MECH_TYPE_ID`,`CONTACT_MECH_PURPOSE_TYPE_ID`),
  KEY `CONT_MECH_TP_TYPE` (`CONTACT_MECH_TYPE_ID`),
  KEY `CONT_MECH_TP_PRPTP` (`CONTACT_MECH_PURPOSE_TYPE_ID`),
  KEY `CNT_MCH_TP_PRS_TXP` (`LAST_UPDATED_TX_STAMP`),
  KEY `CNT_MCH_TP_PRS_TXS` (`CREATED_TX_STAMP`),
  CONSTRAINT `CONT_MECH_TP_PRPTP` FOREIGN KEY (`CONTACT_MECH_PURPOSE_TYPE_ID`) REFERENCES `CONTACT_MECH_PURPOSE_TYPE` (`CONTACT_MECH_PURPOSE_TYPE_ID`),
  CONSTRAINT `CONT_MECH_TP_TYPE` FOREIGN KEY (`CONTACT_MECH_TYPE_ID`) REFERENCES `CONTACT_MECH_TYPE` (`CONTACT_MECH_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `CONTAINER`
--

DROP TABLE IF EXISTS `CONTAINER`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `CONTAINER` (
  `CONTAINER_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CONTAINER_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `FACILITY_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 (`CONTAINER_ID`),
  KEY `CONTAINER_CTTYP` (`CONTAINER_TYPE_ID`),
  KEY `CONTAINER_FACILITY` (`FACILITY_ID`),
  KEY `CONTAINER_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `CONTAINER_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `CONTAINER_CTTYP` FOREIGN KEY (`CONTAINER_TYPE_ID`) REFERENCES `CONTAINER_TYPE` (`CONTAINER_TYPE_ID`),
  CONSTRAINT `CONTAINER_FACILITY` FOREIGN KEY (`FACILITY_ID`) REFERENCES `FACILITY` (`FACILITY_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `CONTAINER_GEO_POINT`
--

DROP TABLE IF EXISTS `CONTAINER_GEO_POINT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `CONTAINER_GEO_POINT` (
  `CONTAINER_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 (`CONTAINER_ID`,`GEO_POINT_ID`,`FROM_DATE`),
  KEY `CONTNRGEOPT_CONTNR` (`CONTAINER_ID`),
  KEY `CONTNRGEOPT_GEOPT` (`GEO_POINT_ID`),
  KEY `CNTNR_G_PNT_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `CNTNR_G_PNT_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `CONTNRGEOPT_CONTNR` FOREIGN KEY (`CONTAINER_ID`) REFERENCES `CONTAINER` (`CONTAINER_ID`),
  CONSTRAINT `CONTNRGEOPT_GEOPT` FOREIGN KEY (`GEO_POINT_ID`) REFERENCES `GEO_POINT` (`GEO_POINT_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `CONTAINER_TYPE`
--

DROP TABLE IF EXISTS `CONTAINER_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `CONTAINER_TYPE` (
  `CONTAINER_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 (`CONTAINER_TYPE_ID`),
  KEY `CNTNR_TP_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `CNTNR_TP_TXCRTS` (`CREATED_TX_STAMP`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `CONTENT`
--

DROP TABLE IF EXISTS `CONTENT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `CONTENT` (
  `CONTENT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CONTENT_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `OWNER_CONTENT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `DECORATOR_CONTENT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `INSTANCE_OF_CONTENT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `DATA_RESOURCE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `TEMPLATE_DATA_RESOURCE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `DATA_SOURCE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `STATUS_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PRIVILEGE_ENUM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SERVICE_NAME` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `CUSTOM_METHOD_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `CONTENT_NAME` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LOCALE_STRING` varchar(10) COLLATE latin1_general_cs DEFAULT NULL,
  `MIME_TYPE_ID` varchar(250) COLLATE latin1_general_cs DEFAULT NULL,
  `CHARACTER_SET_ID` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `CHILD_LEAF_COUNT` decimal(20,0) DEFAULT NULL,
  `CHILD_BRANCH_COUNT` decimal(20,0) 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 (`CONTENT_ID`),
  KEY `CONTENT_TO_TYPE` (`CONTENT_TYPE_ID`),
  KEY `CONTENT_TO_DATA` (`DATA_RESOURCE_ID`),
  KEY `CONTENT_TO_TMPDATA` (`TEMPLATE_DATA_RESOURCE_ID`),
  KEY `CONTENT_STATUS` (`STATUS_ID`),
  KEY `CONTENT_PRIVENM` (`PRIVILEGE_ENUM_ID`),
  KEY `CONTENT_CUSTMET` (`CUSTOM_METHOD_ID`),
  KEY `CONTENT_CHST` (`CHARACTER_SET_ID`),
  KEY `CONTENT_CB_ULGN` (`CREATED_BY_USER_LOGIN`),
  KEY `CONTENT_LMB_ULGN` (`LAST_MODIFIED_BY_USER_LOGIN`),
  KEY `CONTENT_DTSRC` (`DATA_SOURCE_ID`),
  KEY `CONTENT_DCNTNT` (`DECORATOR_CONTENT_ID`),
  KEY `CONTENT_PCNTNT` (`OWNER_CONTENT_ID`),
  KEY `CONTENT_IOFCNT` (`INSTANCE_OF_CONTENT_ID`),
  KEY `CONTENT_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `CONTENT_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `CONTENT_CB_ULGN` FOREIGN KEY (`CREATED_BY_USER_LOGIN`) REFERENCES `USER_LOGIN` (`USER_LOGIN_ID`),
  CONSTRAINT `CONTENT_CHST` FOREIGN KEY (`CHARACTER_SET_ID`) REFERENCES `CHARACTER_SET` (`CHARACTER_SET_ID`),
  CONSTRAINT `CONTENT_CUSTMET` FOREIGN KEY (`CUSTOM_METHOD_ID`) REFERENCES `CUSTOM_METHOD` (`CUSTOM_METHOD_ID`),
  CONSTRAINT `CONTENT_DCNTNT` FOREIGN KEY (`DECORATOR_CONTENT_ID`) REFERENCES `CONTENT` (`CONTENT_ID`),
  CONSTRAINT `CONTENT_DTSRC` FOREIGN KEY (`DATA_SOURCE_ID`) REFERENCES `DATA_SOURCE` (`DATA_SOURCE_ID`),
  CONSTRAINT `CONTENT_IOFCNT` FOREIGN KEY (`INSTANCE_OF_CONTENT_ID`) REFERENCES `CONTENT` (`CONTENT_ID`),
  CONSTRAINT `CONTENT_LMB_ULGN` FOREIGN KEY (`LAST_MODIFIED_BY_USER_LOGIN`) REFERENCES `USER_LOGIN` (`USER_LOGIN_ID`),
  CONSTRAINT `CONTENT_PCNTNT` FOREIGN KEY (`OWNER_CONTENT_ID`) REFERENCES `CONTENT` (`CONTENT_ID`),
  CONSTRAINT `CONTENT_PRIVENM` FOREIGN KEY (`PRIVILEGE_ENUM_ID`) REFERENCES `ENUMERATION` (`ENUM_ID`),
  CONSTRAINT `CONTENT_STATUS` FOREIGN KEY (`STATUS_ID`) REFERENCES `STATUS_ITEM` (`STATUS_ID`),
  CONSTRAINT `CONTENT_TO_DATA` FOREIGN KEY (`DATA_RESOURCE_ID`) REFERENCES `DATA_RESOURCE` (`DATA_RESOURCE_ID`),
  CONSTRAINT `CONTENT_TO_TMPDATA` FOREIGN KEY (`TEMPLATE_DATA_RESOURCE_ID`) REFERENCES `DATA_RESOURCE` (`DATA_RESOURCE_ID`),
  CONSTRAINT `CONTENT_TO_TYPE` FOREIGN KEY (`CONTENT_TYPE_ID`) REFERENCES `CONTENT_TYPE` (`CONTENT_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `CONTENT_APPROVAL`
--

DROP TABLE IF EXISTS `CONTENT_APPROVAL`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `CONTENT_APPROVAL` (
  `CONTENT_APPROVAL_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CONTENT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `CONTENT_REVISION_SEQ_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ROLE_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `APPROVAL_STATUS_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `APPROVAL_DATE` datetime DEFAULT NULL,
  `SEQUENCE_NUM` decimal(20,0) 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 (`CONTENT_APPROVAL_ID`),
  KEY `CNTNTAPPR_CNT` (`CONTENT_ID`),
  KEY `CNTNTAPPR_PTY` (`PARTY_ID`),
  KEY `CNTNTAPPR_RLTP` (`ROLE_TYPE_ID`),
  KEY `CNTNTAPPR_APSI` (`APPROVAL_STATUS_ID`),
  KEY `CNTNT_APPRL_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `CNTNT_APPRL_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `CNTNTAPPR_APSI` FOREIGN KEY (`APPROVAL_STATUS_ID`) REFERENCES `STATUS_ITEM` (`STATUS_ID`),
  CONSTRAINT `CNTNTAPPR_CNT` FOREIGN KEY (`CONTENT_ID`) REFERENCES `CONTENT` (`CONTENT_ID`),
  CONSTRAINT `CNTNTAPPR_PTY` FOREIGN KEY (`PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `CNTNTAPPR_RLTP` 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 `CONTENT_ASSOC`
--

DROP TABLE IF EXISTS `CONTENT_ASSOC`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `CONTENT_ASSOC` (
  `CONTENT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CONTENT_ID_TO` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CONTENT_ASSOC_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FROM_DATE` datetime NOT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `CONTENT_ASSOC_PREDICATE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `DATA_SOURCE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SEQUENCE_NUM` decimal(20,0) DEFAULT NULL,
  `MAP_KEY` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `UPPER_COORDINATE` decimal(20,0) DEFAULT NULL,
  `LEFT_COORDINATE` decimal(20,0) 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 (`CONTENT_ID`,`CONTENT_ID_TO`,`CONTENT_ASSOC_TYPE_ID`,`FROM_DATE`),
  KEY `CONTENTASSC_FROM` (`CONTENT_ID`),
  KEY `CONTENTASSC_TO` (`CONTENT_ID_TO`),
  KEY `CONTENTASSC_TYP` (`CONTENT_ASSOC_TYPE_ID`),
  KEY `CONTENTASSC_CBUSR` (`CREATED_BY_USER_LOGIN`),
  KEY `CONTENTASSC_LMBUR` (`LAST_MODIFIED_BY_USER_LOGIN`),
  KEY `CONTENTASSC_PRED` (`CONTENT_ASSOC_PREDICATE_ID`),
  KEY `CONTENTASSC_DTSRC` (`DATA_SOURCE_ID`),
  KEY `CNTNT_ASSC_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `CNTNT_ASSC_TXCRTS` (`CREATED_TX_STAMP`),
  KEY `CONTENTASSC_TOQRY` (`CONTENT_ID_TO`,`CONTENT_ASSOC_TYPE_ID`,`THRU_DATE`),
  CONSTRAINT `CONTENTASSC_CBUSR` FOREIGN KEY (`CREATED_BY_USER_LOGIN`) REFERENCES `USER_LOGIN` (`USER_LOGIN_ID`),
  CONSTRAINT `CONTENTASSC_DTSRC` FOREIGN KEY (`DATA_SOURCE_ID`) REFERENCES `DATA_SOURCE` (`DATA_SOURCE_ID`),
  CONSTRAINT `CONTENTASSC_FROM` FOREIGN KEY (`CONTENT_ID`) REFERENCES `CONTENT` (`CONTENT_ID`),
  CONSTRAINT `CONTENTASSC_LMBUR` FOREIGN KEY (`LAST_MODIFIED_BY_USER_LOGIN`) REFERENCES `USER_LOGIN` (`USER_LOGIN_ID`),
  CONSTRAINT `CONTENTASSC_PRED` FOREIGN KEY (`CONTENT_ASSOC_PREDICATE_ID`) REFERENCES `CONTENT_ASSOC_PREDICATE` (`CONTENT_ASSOC_PREDICATE_ID`),
  CONSTRAINT `CONTENTASSC_TO` FOREIGN KEY (`CONTENT_ID_TO`) REFERENCES `CONTENT` (`CONTENT_ID`),
  CONSTRAINT `CONTENTASSC_TYP` FOREIGN KEY (`CONTENT_ASSOC_TYPE_ID`) REFERENCES `CONTENT_ASSOC_TYPE` (`CONTENT_ASSOC_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `CONTENT_ASSOC_PREDICATE`
--

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

--
-- Table structure for table `CONTENT_ASSOC_TYPE`
--

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

--
-- Table structure for table `CONTENT_ATTRIBUTE`
--

DROP TABLE IF EXISTS `CONTENT_ATTRIBUTE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `CONTENT_ATTRIBUTE` (
  `CONTENT_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 (`CONTENT_ID`,`ATTR_NAME`),
  KEY `CONTENT_ATTR` (`CONTENT_ID`),
  KEY `CNTNT_ATTRT_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `CNTNT_ATTRT_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `CONTENT_ATTR` FOREIGN KEY (`CONTENT_ID`) REFERENCES `CONTENT` (`CONTENT_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `CONTENT_KEYWORD`
--

DROP TABLE IF EXISTS `CONTENT_KEYWORD`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `CONTENT_KEYWORD` (
  `CONTENT_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 (`CONTENT_ID`,`KEYWORD`),
  KEY `CNT_KWD_CNT` (`CONTENT_ID`),
  KEY `CNTNT_KWRD_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `CNTNT_KWRD_TXCRTS` (`CREATED_TX_STAMP`),
  KEY `CNT_KWD_KWD` (`KEYWORD`),
  CONSTRAINT `CNT_KWD_CNT` FOREIGN KEY (`CONTENT_ID`) REFERENCES `CONTENT` (`CONTENT_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `CONTENT_META_DATA`
--

DROP TABLE IF EXISTS `CONTENT_META_DATA`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `CONTENT_META_DATA` (
  `CONTENT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `META_DATA_PREDICATE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `META_DATA_VALUE` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `DATA_SOURCE_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 (`CONTENT_ID`,`META_DATA_PREDICATE_ID`),
  KEY `CONTENTMD_CNTNT` (`CONTENT_ID`),
  KEY `CONTENTMD_DMDPRD` (`META_DATA_PREDICATE_ID`),
  KEY `CONTENTMD_DTSRC` (`DATA_SOURCE_ID`),
  KEY `CNTNT_MT_DT_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `CNTNT_MT_DT_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `CONTENTMD_CNTNT` FOREIGN KEY (`CONTENT_ID`) REFERENCES `CONTENT` (`CONTENT_ID`),
  CONSTRAINT `CONTENTMD_DMDPRD` FOREIGN KEY (`META_DATA_PREDICATE_ID`) REFERENCES `META_DATA_PREDICATE` (`META_DATA_PREDICATE_ID`),
  CONSTRAINT `CONTENTMD_DTSRC` FOREIGN KEY (`DATA_SOURCE_ID`) REFERENCES `DATA_SOURCE` (`DATA_SOURCE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `CONTENT_OPERATION`
--

DROP TABLE IF EXISTS `CONTENT_OPERATION`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `CONTENT_OPERATION` (
  `CONTENT_OPERATION_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 (`CONTENT_OPERATION_ID`),
  KEY `CNTNT_OPRTN_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `CNTNT_OPRTN_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 `CONTENT_PURPOSE`
--

DROP TABLE IF EXISTS `CONTENT_PURPOSE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `CONTENT_PURPOSE` (
  `CONTENT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CONTENT_PURPOSE_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT 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 (`CONTENT_ID`,`CONTENT_PURPOSE_TYPE_ID`),
  KEY `CONTENT_PRP` (`CONTENT_ID`),
  KEY `CONTENT_PRP_TYPE` (`CONTENT_PURPOSE_TYPE_ID`),
  KEY `CNTNT_PRPS_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `CNTNT_PRPS_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `CONTENT_PRP` FOREIGN KEY (`CONTENT_ID`) REFERENCES `CONTENT` (`CONTENT_ID`),
  CONSTRAINT `CONTENT_PRP_TYPE` FOREIGN KEY (`CONTENT_PURPOSE_TYPE_ID`) REFERENCES `CONTENT_PURPOSE_TYPE` (`CONTENT_PURPOSE_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `CONTENT_PURPOSE_OPERATION`
--

DROP TABLE IF EXISTS `CONTENT_PURPOSE_OPERATION`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `CONTENT_PURPOSE_OPERATION` (
  `CONTENT_PURPOSE_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CONTENT_OPERATION_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ROLE_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `STATUS_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRIVILEGE_ENUM_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 (`CONTENT_PURPOSE_TYPE_ID`,`CONTENT_OPERATION_ID`,`ROLE_TYPE_ID`,`STATUS_ID`,`PRIVILEGE_ENUM_ID`),
  KEY `CONTENT_PRO_TYPE` (`CONTENT_PURPOSE_TYPE_ID`),
  KEY `CONTENT_PRO_OPER` (`CONTENT_OPERATION_ID`),
  KEY `CONTENT_PRO_RLT` (`ROLE_TYPE_ID`),
  KEY `CONTENT_PRO_STI` (`STATUS_ID`),
  KEY `CONTENT_PRO_PEI` (`PRIVILEGE_ENUM_ID`),
  KEY `CNTT_PRS_OPN_TXSTP` (`LAST_UPDATED_TX_STAMP`),
  KEY `CNTT_PRS_OPN_TXCRS` (`CREATED_TX_STAMP`),
  CONSTRAINT `CONTENT_PRO_OPER` FOREIGN KEY (`CONTENT_OPERATION_ID`) REFERENCES `CONTENT_OPERATION` (`CONTENT_OPERATION_ID`),
  CONSTRAINT `CONTENT_PRO_PEI` FOREIGN KEY (`PRIVILEGE_ENUM_ID`) REFERENCES `ENUMERATION` (`ENUM_ID`),
  CONSTRAINT `CONTENT_PRO_RLT` FOREIGN KEY (`ROLE_TYPE_ID`) REFERENCES `ROLE_TYPE` (`ROLE_TYPE_ID`),
  CONSTRAINT `CONTENT_PRO_STI` FOREIGN KEY (`STATUS_ID`) REFERENCES `STATUS_ITEM` (`STATUS_ID`),
  CONSTRAINT `CONTENT_PRO_TYPE` FOREIGN KEY (`CONTENT_PURPOSE_TYPE_ID`) REFERENCES `CONTENT_PURPOSE_TYPE` (`CONTENT_PURPOSE_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `CONTENT_PURPOSE_TYPE`
--

DROP TABLE IF EXISTS `CONTENT_PURPOSE_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `CONTENT_PURPOSE_TYPE` (
  `CONTENT_PURPOSE_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 (`CONTENT_PURPOSE_TYPE_ID`),
  KEY `CNTT_PRS_TP_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `CNTT_PRS_TP_TXCRTS` (`CREATED_TX_STAMP`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `CONTENT_REVISION`
--

DROP TABLE IF EXISTS `CONTENT_REVISION`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `CONTENT_REVISION` (
  `CONTENT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CONTENT_REVISION_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `COMMITTED_BY_PARTY_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 (`CONTENT_ID`,`CONTENT_REVISION_SEQ_ID`),
  KEY `CNTNTREV_CNT` (`CONTENT_ID`),
  KEY `CNTNTREV_CBPTY` (`COMMITTED_BY_PARTY_ID`),
  KEY `CNTNT_RVSN_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `CNTNT_RVSN_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `CNTNTREV_CBPTY` FOREIGN KEY (`COMMITTED_BY_PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `CNTNTREV_CNT` FOREIGN KEY (`CONTENT_ID`) REFERENCES `CONTENT` (`CONTENT_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `CONTENT_REVISION_ITEM`
--

DROP TABLE IF EXISTS `CONTENT_REVISION_ITEM`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `CONTENT_REVISION_ITEM` (
  `CONTENT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CONTENT_REVISION_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ITEM_CONTENT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `OLD_DATA_RESOURCE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `NEW_DATA_RESOURCE_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 (`CONTENT_ID`,`CONTENT_REVISION_SEQ_ID`,`ITEM_CONTENT_ID`),
  KEY `CNTNTREVIT_CNTREV` (`CONTENT_ID`,`CONTENT_REVISION_SEQ_ID`),
  KEY `CNTNTREVIT_OLDDR` (`OLD_DATA_RESOURCE_ID`),
  KEY `CNTNTREVIT_NEWDR` (`NEW_DATA_RESOURCE_ID`),
  KEY `CNTT_RVN_ITM_TXSTP` (`LAST_UPDATED_TX_STAMP`),
  KEY `CNTT_RVN_ITM_TXCRS` (`CREATED_TX_STAMP`),
  CONSTRAINT `CNTNTREVIT_CNTREV` FOREIGN KEY (`CONTENT_ID`, `CONTENT_REVISION_SEQ_ID`) REFERENCES `CONTENT_REVISION` (`CONTENT_ID`, `CONTENT_REVISION_SEQ_ID`),
  CONSTRAINT `CNTNTREVIT_NEWDR` FOREIGN KEY (`NEW_DATA_RESOURCE_ID`) REFERENCES `DATA_RESOURCE` (`DATA_RESOURCE_ID`),
  CONSTRAINT `CNTNTREVIT_OLDDR` FOREIGN KEY (`OLD_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 `CONTENT_ROLE`
--

DROP TABLE IF EXISTS `CONTENT_ROLE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `CONTENT_ROLE` (
  `CONTENT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ROLE_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FROM_DATE` datetime NOT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`CONTENT_ID`,`PARTY_ID`,`ROLE_TYPE_ID`,`FROM_DATE`),
  KEY `CNTNT_RL_CNTNT` (`CONTENT_ID`),
  KEY `CNTNT_RL_PTRL` (`PARTY_ID`,`ROLE_TYPE_ID`),
  KEY `CNTNT_RL_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `CNTNT_RL_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `CNTNT_RL_CNTNT` FOREIGN KEY (`CONTENT_ID`) REFERENCES `CONTENT` (`CONTENT_ID`),
  CONSTRAINT `CNTNT_RL_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 `CONTENT_SEARCH_CONSTRAINT`
--

DROP TABLE IF EXISTS `CONTENT_SEARCH_CONSTRAINT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `CONTENT_SEARCH_CONSTRAINT` (
  `CONTENT_SEARCH_RESULT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CONSTRAINT_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CONSTRAINT_NAME` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `INFO_STRING` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `INCLUDE_SUB_CATEGORIES` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `IS_AND` char(1) 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,
  `LOW_VALUE` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `HIGH_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 (`CONTENT_SEARCH_RESULT_ID`,`CONSTRAINT_SEQ_ID`),
  KEY `CNT_SCHRSI_RES` (`CONTENT_SEARCH_RESULT_ID`),
  KEY `CNT_SRH_CNSTT_TXSP` (`LAST_UPDATED_TX_STAMP`),
  KEY `CNT_SRH_CNSTT_TXCS` (`CREATED_TX_STAMP`),
  CONSTRAINT `CNT_SCHRSI_RES` FOREIGN KEY (`CONTENT_SEARCH_RESULT_ID`) REFERENCES `CONTENT_SEARCH_RESULT` (`CONTENT_SEARCH_RESULT_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `CONTENT_SEARCH_RESULT`
--

DROP TABLE IF EXISTS `CONTENT_SEARCH_RESULT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `CONTENT_SEARCH_RESULT` (
  `CONTENT_SEARCH_RESULT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `VISIT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ORDER_BY_NAME` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `IS_ASCENDING` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `NUM_RESULTS` decimal(20,0) DEFAULT NULL,
  `SECONDS_TOTAL` double DEFAULT NULL,
  `SEARCH_DATE` datetime DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`CONTENT_SEARCH_RESULT_ID`),
  KEY `CNT_SCHRES_VST` (`VISIT_ID`),
  KEY `CNTT_SRH_RST_TXSTP` (`LAST_UPDATED_TX_STAMP`),
  KEY `CNTT_SRH_RST_TXCRS` (`CREATED_TX_STAMP`),
  CONSTRAINT `CNT_SCHRES_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 `CONTENT_TYPE`
--

DROP TABLE IF EXISTS `CONTENT_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `CONTENT_TYPE` (
  `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 (`CONTENT_TYPE_ID`),
  KEY `CNTNT_TYPE_PARENT` (`PARENT_TYPE_ID`),
  KEY `CNTNT_TP_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `CNTNT_TP_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `CNTNT_TYPE_PARENT` FOREIGN KEY (`PARENT_TYPE_ID`) REFERENCES `CONTENT_TYPE` (`CONTENT_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `CONTENT_TYPE_ATTR`
--

DROP TABLE IF EXISTS `CONTENT_TYPE_ATTR`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `CONTENT_TYPE_ATTR` (
  `CONTENT_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 (`CONTENT_TYPE_ID`,`ATTR_NAME`),
  KEY `CONTENT_TPAT_TYP` (`CONTENT_TYPE_ID`),
  KEY `CNTT_TP_ATR_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `CNTT_TP_ATR_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `CONTENT_TPAT_TYP` FOREIGN KEY (`CONTENT_TYPE_ID`) REFERENCES `CONTENT_TYPE` (`CONTENT_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `COST_COMPONENT`
--

DROP TABLE IF EXISTS `COST_COMPONENT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `COST_COMPONENT` (
  `COST_COMPONENT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `COST_COMPONENT_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PRODUCT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PRODUCT_FEATURE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `GEO_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `WORK_EFFORT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `FIXED_ASSET_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `COST_COMPONENT_CALC_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `FROM_DATE` datetime DEFAULT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `COST` decimal(18,6) DEFAULT NULL,
  `COST_UOM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`COST_COMPONENT_ID`),
  KEY `COST_COMP_TYPE` (`COST_COMPONENT_TYPE_ID`),
  KEY `COST_COMP_PRODUCT` (`PRODUCT_ID`),
  KEY `COST_COMP_PRODFEAT` (`PRODUCT_FEATURE_ID`),
  KEY `COST_COMP_PARTY` (`PARTY_ID`),
  KEY `COST_COMP_GEO` (`GEO_ID`),
  KEY `COST_COMP_WEFF` (`WORK_EFFORT_ID`),
  KEY `COST_COMP_FXADSST` (`FIXED_ASSET_ID`),
  KEY `COST_COMP_CALC` (`COST_COMPONENT_CALC_ID`),
  KEY `COST_COMP_CUOM` (`COST_UOM_ID`),
  KEY `CST_CMPNNT_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `CST_CMPNNT_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `COST_COMP_CALC` FOREIGN KEY (`COST_COMPONENT_CALC_ID`) REFERENCES `COST_COMPONENT_CALC` (`COST_COMPONENT_CALC_ID`),
  CONSTRAINT `COST_COMP_CUOM` FOREIGN KEY (`COST_UOM_ID`) REFERENCES `UOM` (`UOM_ID`),
  CONSTRAINT `COST_COMP_FXADSST` FOREIGN KEY (`FIXED_ASSET_ID`) REFERENCES `FIXED_ASSET` (`FIXED_ASSET_ID`),
  CONSTRAINT `COST_COMP_GEO` FOREIGN KEY (`GEO_ID`) REFERENCES `GEO` (`GEO_ID`),
  CONSTRAINT `COST_COMP_PARTY` FOREIGN KEY (`PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `COST_COMP_PRODFEAT` FOREIGN KEY (`PRODUCT_FEATURE_ID`) REFERENCES `PRODUCT_FEATURE` (`PRODUCT_FEATURE_ID`),
  CONSTRAINT `COST_COMP_PRODUCT` FOREIGN KEY (`PRODUCT_ID`) REFERENCES `PRODUCT` (`PRODUCT_ID`),
  CONSTRAINT `COST_COMP_TYPE` FOREIGN KEY (`COST_COMPONENT_TYPE_ID`) REFERENCES `COST_COMPONENT_TYPE` (`COST_COMPONENT_TYPE_ID`),
  CONSTRAINT `COST_COMP_WEFF` FOREIGN KEY (`WORK_EFFORT_ID`) REFERENCES `WORK_EFFORT` (`WORK_EFFORT_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `COST_COMPONENT_ATTRIBUTE`
--

DROP TABLE IF EXISTS `COST_COMPONENT_ATTRIBUTE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `COST_COMPONENT_ATTRIBUTE` (
  `COST_COMPONENT_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 (`COST_COMPONENT_ID`,`ATTR_NAME`),
  KEY `COST_COMP_ATTR` (`COST_COMPONENT_ID`),
  KEY `CST_CMPT_ATTT_TXSP` (`LAST_UPDATED_TX_STAMP`),
  KEY `CST_CMPT_ATTT_TXCS` (`CREATED_TX_STAMP`),
  CONSTRAINT `COST_COMP_ATTR` FOREIGN KEY (`COST_COMPONENT_ID`) REFERENCES `COST_COMPONENT` (`COST_COMPONENT_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `COST_COMPONENT_CALC`
--

DROP TABLE IF EXISTS `COST_COMPONENT_CALC`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `COST_COMPONENT_CALC` (
  `COST_COMPONENT_CALC_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `COST_GL_ACCOUNT_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `OFFSETTING_GL_ACCOUNT_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `FIXED_COST` decimal(18,2) DEFAULT NULL,
  `VARIABLE_COST` decimal(18,2) DEFAULT NULL,
  `PER_MILLI_SECOND` decimal(20,0) DEFAULT NULL,
  `CURRENCY_UOM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `COST_CUSTOM_METHOD_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 (`COST_COMPONENT_CALC_ID`),
  KEY `COST_COM_CGLAT` (`COST_GL_ACCOUNT_TYPE_ID`),
  KEY `COST_COM_OGLAT` (`OFFSETTING_GL_ACCOUNT_TYPE_ID`),
  KEY `COST_COM_CUOM` (`CURRENCY_UOM_ID`),
  KEY `COST_COM_CMET` (`COST_CUSTOM_METHOD_ID`),
  KEY `CST_CMPT_CLC_TXSTP` (`LAST_UPDATED_TX_STAMP`),
  KEY `CST_CMPT_CLC_TXCRS` (`CREATED_TX_STAMP`),
  CONSTRAINT `COST_COM_CGLAT` FOREIGN KEY (`COST_GL_ACCOUNT_TYPE_ID`) REFERENCES `GL_ACCOUNT_TYPE` (`GL_ACCOUNT_TYPE_ID`),
  CONSTRAINT `COST_COM_CMET` FOREIGN KEY (`COST_CUSTOM_METHOD_ID`) REFERENCES `CUSTOM_METHOD` (`CUSTOM_METHOD_ID`),
  CONSTRAINT `COST_COM_CUOM` FOREIGN KEY (`CURRENCY_UOM_ID`) REFERENCES `UOM` (`UOM_ID`),
  CONSTRAINT `COST_COM_OGLAT` FOREIGN KEY (`OFFSETTING_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 `COST_COMPONENT_TYPE`
--

DROP TABLE IF EXISTS `COST_COMPONENT_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `COST_COMPONENT_TYPE` (
  `COST_COMPONENT_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 (`COST_COMPONENT_TYPE_ID`),
  KEY `COST_COMP_TYPE_PAR` (`PARENT_TYPE_ID`),
  KEY `CST_CMPNT_TP_TXSTP` (`LAST_UPDATED_TX_STAMP`),
  KEY `CST_CMPNT_TP_TXCRS` (`CREATED_TX_STAMP`),
  CONSTRAINT `COST_COMP_TYPE_PAR` FOREIGN KEY (`PARENT_TYPE_ID`) REFERENCES `COST_COMPONENT_TYPE` (`COST_COMPONENT_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `COST_COMPONENT_TYPE_ATTR`
--

DROP TABLE IF EXISTS `COST_COMPONENT_TYPE_ATTR`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `COST_COMPONENT_TYPE_ATTR` (
  `COST_COMPONENT_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 (`COST_COMPONENT_TYPE_ID`,`ATTR_NAME`),
  KEY `COST_COMP_TATTR` (`COST_COMPONENT_TYPE_ID`),
  KEY `CST_CMT_TP_ATR_TXP` (`LAST_UPDATED_TX_STAMP`),
  KEY `CST_CMT_TP_ATR_TXS` (`CREATED_TX_STAMP`),
  CONSTRAINT `COST_COMP_TATTR` FOREIGN KEY (`COST_COMPONENT_TYPE_ID`) REFERENCES `COST_COMPONENT_TYPE` (`COST_COMPONENT_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `COUNTRY_ADDRESS_FORMAT`
--

DROP TABLE IF EXISTS `COUNTRY_ADDRESS_FORMAT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `COUNTRY_ADDRESS_FORMAT` (
  `GEO_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `GEO_ASSOC_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `REQUIRE_STATE_PROVINCE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `REQUIRE_POSTAL_CODE` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `POSTAL_CODE_REGEX` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `HAS_POSTAL_CODE_EXT` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `REQUIRE_POSTAL_CODE_EXT` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `ADDRESS_FORMAT` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`GEO_ID`),
  KEY `CNY_ADR_GEO` (`GEO_ID`),
  KEY `CNY_ADR_GEO_TYPE` (`GEO_ASSOC_TYPE_ID`),
  KEY `CNR_ADDS_FRT_TXSTP` (`LAST_UPDATED_TX_STAMP`),
  KEY `CNR_ADDS_FRT_TXCRS` (`CREATED_TX_STAMP`),
  CONSTRAINT `CNY_ADR_GEO` FOREIGN KEY (`GEO_ID`) REFERENCES `GEO` (`GEO_ID`),
  CONSTRAINT `CNY_ADR_GEO_TYPE` FOREIGN KEY (`GEO_ASSOC_TYPE_ID`) REFERENCES `GEO_ASSOC_TYPE` (`GEO_ASSOC_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `COUNTRY_CAPITAL`
--

DROP TABLE IF EXISTS `COUNTRY_CAPITAL`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `COUNTRY_CAPITAL` (
  `COUNTRY_CODE` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `COUNTRY_CAPITAL` 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 (`COUNTRY_CODE`),
  KEY `CNTRY_CAP_TO_CODE` (`COUNTRY_CODE`),
  KEY `CNTR_CPTL_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `CNTR_CPTL_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `CNTRY_CAP_TO_CODE` FOREIGN KEY (`COUNTRY_CODE`) REFERENCES `COUNTRY_CODE` (`COUNTRY_CODE`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `COUNTRY_CODE`
--

DROP TABLE IF EXISTS `COUNTRY_CODE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `COUNTRY_CODE` (
  `COUNTRY_CODE` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `COUNTRY_ABBR` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `COUNTRY_NUMBER` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `COUNTRY_NAME` 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 (`COUNTRY_CODE`),
  KEY `CNTR_CD_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `CNTR_CD_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 `COUNTRY_TELE_CODE`
--

DROP TABLE IF EXISTS `COUNTRY_TELE_CODE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `COUNTRY_TELE_CODE` (
  `COUNTRY_CODE` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `TELE_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 (`COUNTRY_CODE`),
  KEY `CNTRY_TELE_TO_CODE` (`COUNTRY_CODE`),
  KEY `CNTR_TL_CD_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `CNTR_TL_CD_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `CNTRY_TELE_TO_CODE` FOREIGN KEY (`COUNTRY_CODE`) REFERENCES `COUNTRY_CODE` (`COUNTRY_CODE`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `CREDIT_CARD`
--

DROP TABLE IF EXISTS `CREDIT_CARD`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `CREDIT_CARD` (
  `PAYMENT_METHOD_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CARD_TYPE` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `CARD_NUMBER` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `VALID_FROM_DATE` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `EXPIRE_DATE` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ISSUE_NUMBER` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `COMPANY_NAME_ON_CARD` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `TITLE_ON_CARD` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `FIRST_NAME_ON_CARD` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `MIDDLE_NAME_ON_CARD` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_NAME_ON_CARD` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `SUFFIX_ON_CARD` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `CONTACT_MECH_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `CONSECUTIVE_FAILED_AUTHS` decimal(20,0) DEFAULT NULL,
  `LAST_FAILED_AUTH_DATE` datetime DEFAULT NULL,
  `CONSECUTIVE_FAILED_NSF` decimal(20,0) DEFAULT NULL,
  `LAST_FAILED_NSF_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 `CREDCARD_PMNTMETH` (`PAYMENT_METHOD_ID`),
  KEY `CREDCARD_CMECH` (`CONTACT_MECH_ID`),
  KEY `CREDCARD_PADDR` (`CONTACT_MECH_ID`),
  KEY `CREDIT_CARD_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `CREDIT_CARD_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `CREDCARD_CMECH` FOREIGN KEY (`CONTACT_MECH_ID`) REFERENCES `CONTACT_MECH` (`CONTACT_MECH_ID`),
  CONSTRAINT `CREDCARD_PADDR` FOREIGN KEY (`CONTACT_MECH_ID`) REFERENCES `POSTAL_ADDRESS` (`CONTACT_MECH_ID`),
  CONSTRAINT `CREDCARD_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 `CREDIT_CARD_TYPE_GL_ACCOUNT`
--

DROP TABLE IF EXISTS `CREDIT_CARD_TYPE_GL_ACCOUNT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `CREDIT_CARD_TYPE_GL_ACCOUNT` (
  `CARD_TYPE` varchar(60) 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 (`CARD_TYPE`,`ORGANIZATION_PARTY_ID`),
  KEY `CRT_TP_GL_ACT_TP` (`LAST_UPDATED_TX_STAMP`),
  KEY `CRT_TP_GL_ACT_TS` (`CREATED_TX_STAMP`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `CUSTOM_METHOD`
--

DROP TABLE IF EXISTS `CUSTOM_METHOD`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `CUSTOM_METHOD` (
  `CUSTOM_METHOD_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CUSTOM_METHOD_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `CUSTOM_METHOD_NAME` varchar(255) 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 (`CUSTOM_METHOD_ID`),
  KEY `CME_TO_TYPE` (`CUSTOM_METHOD_TYPE_ID`),
  KEY `CSTM_MTHD_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `CSTM_MTHD_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `CME_TO_TYPE` FOREIGN KEY (`CUSTOM_METHOD_TYPE_ID`) REFERENCES `CUSTOM_METHOD_TYPE` (`CUSTOM_METHOD_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `CUSTOM_METHOD_TYPE`
--

DROP TABLE IF EXISTS `CUSTOM_METHOD_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `CUSTOM_METHOD_TYPE` (
  `CUSTOM_METHOD_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 (`CUSTOM_METHOD_TYPE_ID`),
  KEY `CME_TYPE_PARENT` (`PARENT_TYPE_ID`),
  KEY `CSTM_MTD_TP_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `CSTM_MTD_TP_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `CME_TYPE_PARENT` FOREIGN KEY (`PARENT_TYPE_ID`) REFERENCES `CUSTOM_METHOD_TYPE` (`CUSTOM_METHOD_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `CUSTOM_TIME_PERIOD`
--

DROP TABLE IF EXISTS `CUSTOM_TIME_PERIOD`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `CUSTOM_TIME_PERIOD` (
  `CUSTOM_TIME_PERIOD_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARENT_PERIOD_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PERIOD_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PERIOD_NUM` decimal(20,0) DEFAULT NULL,
  `PERIOD_NAME` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `FROM_DATE` date DEFAULT NULL,
  `THRU_DATE` date DEFAULT NULL,
  `IS_CLOSED` 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,
  `ORGANIZATION_PARTY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  PRIMARY KEY (`CUSTOM_TIME_PERIOD_ID`),
  KEY `ORG_PRD_PARPER` (`PARENT_PERIOD_ID`),
  KEY `ORG_PRD_PERTYP` (`PERIOD_TYPE_ID`),
  KEY `ORG_PRD_PARTY` (`ORGANIZATION_PARTY_ID`),
  KEY `CSTM_TM_PRD_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `CSTM_TM_PRD_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `ORG_PRD_PARPER` FOREIGN KEY (`PARENT_PERIOD_ID`) REFERENCES `CUSTOM_TIME_PERIOD` (`CUSTOM_TIME_PERIOD_ID`),
  CONSTRAINT `ORG_PRD_PARTY` FOREIGN KEY (`ORGANIZATION_PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `ORG_PRD_PERTYP` FOREIGN KEY (`PERIOD_TYPE_ID`) REFERENCES `PERIOD_TYPE` (`PERIOD_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `CUST_REQUEST`
--

DROP TABLE IF EXISTS `CUST_REQUEST`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `CUST_REQUEST` (
  `CUST_REQUEST_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CUST_REQUEST_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `CUST_REQUEST_CATEGORY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `STATUS_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `FROM_PARTY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PRIORITY` decimal(20,0) DEFAULT NULL,
  `CUST_REQUEST_DATE` datetime DEFAULT NULL,
  `RESPONSE_REQUIRED_DATE` datetime DEFAULT NULL,
  `CUST_REQUEST_NAME` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `MAXIMUM_AMOUNT_UOM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PRODUCT_STORE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SALES_CHANNEL_ENUM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `FULFILL_CONTACT_MECH_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `CURRENCY_UOM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `OPEN_DATE_TIME` datetime DEFAULT NULL,
  `CLOSED_DATE_TIME` datetime DEFAULT NULL,
  `INTERNAL_COMMENT` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `REASON` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `CREATED_DATE` datetime DEFAULT NULL,
  `CREATED_BY_USER_LOGIN` varchar(250) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_MODIFIED_DATE` datetime DEFAULT NULL,
  `LAST_MODIFIED_BY_USER_LOGIN` varchar(250) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`CUST_REQUEST_ID`),
  KEY `CUST_REQ_TYPE` (`CUST_REQUEST_TYPE_ID`),
  KEY `CUST_REQ_CAT` (`CUST_REQUEST_CATEGORY_ID`),
  KEY `CUST_REQ_STATUS` (`STATUS_ID`),
  KEY `CUST_REQ_FRMPTY` (`FROM_PARTY_ID`),
  KEY `CUST_REQ_AUOM` (`MAXIMUM_AMOUNT_UOM_ID`),
  KEY `CUST_REQ_PRDS` (`PRODUCT_STORE_ID`),
  KEY `CUST_REQ_CHANNEL` (`SALES_CHANNEL_ENUM_ID`),
  KEY `CUST_REQ_FULCM` (`FULFILL_CONTACT_MECH_ID`),
  KEY `CUST_REQ_CUOM` (`CURRENCY_UOM_ID`),
  KEY `CST_RQST_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `CST_RQST_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `CUST_REQ_AUOM` FOREIGN KEY (`MAXIMUM_AMOUNT_UOM_ID`) REFERENCES `UOM` (`UOM_ID`),
  CONSTRAINT `CUST_REQ_CAT` FOREIGN KEY (`CUST_REQUEST_CATEGORY_ID`) REFERENCES `CUST_REQUEST_CATEGORY` (`CUST_REQUEST_CATEGORY_ID`),
  CONSTRAINT `CUST_REQ_CHANNEL` FOREIGN KEY (`SALES_CHANNEL_ENUM_ID`) REFERENCES `ENUMERATION` (`ENUM_ID`),
  CONSTRAINT `CUST_REQ_CUOM` FOREIGN KEY (`CURRENCY_UOM_ID`) REFERENCES `UOM` (`UOM_ID`),
  CONSTRAINT `CUST_REQ_FRMPTY` FOREIGN KEY (`FROM_PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `CUST_REQ_FULCM` FOREIGN KEY (`FULFILL_CONTACT_MECH_ID`) REFERENCES `CONTACT_MECH` (`CONTACT_MECH_ID`),
  CONSTRAINT `CUST_REQ_PRDS` FOREIGN KEY (`PRODUCT_STORE_ID`) REFERENCES `PRODUCT_STORE` (`PRODUCT_STORE_ID`),
  CONSTRAINT `CUST_REQ_STATUS` FOREIGN KEY (`STATUS_ID`) REFERENCES `STATUS_ITEM` (`STATUS_ID`),
  CONSTRAINT `CUST_REQ_TYPE` FOREIGN KEY (`CUST_REQUEST_TYPE_ID`) REFERENCES `CUST_REQUEST_TYPE` (`CUST_REQUEST_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `CUST_REQUEST_ATTRIBUTE`
--

DROP TABLE IF EXISTS `CUST_REQUEST_ATTRIBUTE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `CUST_REQUEST_ATTRIBUTE` (
  `CUST_REQUEST_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 (`CUST_REQUEST_ID`,`ATTR_NAME`),
  KEY `CUST_REQ_ATTR` (`CUST_REQUEST_ID`),
  KEY `CST_RQT_ATTT_TXSTP` (`LAST_UPDATED_TX_STAMP`),
  KEY `CST_RQT_ATTT_TXCRS` (`CREATED_TX_STAMP`),
  CONSTRAINT `CUST_REQ_ATTR` FOREIGN KEY (`CUST_REQUEST_ID`) REFERENCES `CUST_REQUEST` (`CUST_REQUEST_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `CUST_REQUEST_CATEGORY`
--

DROP TABLE IF EXISTS `CUST_REQUEST_CATEGORY`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `CUST_REQUEST_CATEGORY` (
  `CUST_REQUEST_CATEGORY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CUST_REQUEST_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 (`CUST_REQUEST_CATEGORY_ID`),
  KEY `CUST_RQCT_TYPE` (`CUST_REQUEST_TYPE_ID`),
  KEY `CST_RQT_CTR_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `CST_RQT_CTR_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `CUST_RQCT_TYPE` FOREIGN KEY (`CUST_REQUEST_TYPE_ID`) REFERENCES `CUST_REQUEST_TYPE` (`CUST_REQUEST_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `CUST_REQUEST_COMM_EVENT`
--

DROP TABLE IF EXISTS `CUST_REQUEST_COMM_EVENT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `CUST_REQUEST_COMM_EVENT` (
  `CUST_REQUEST_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `COMMUNICATION_EVENT_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 (`CUST_REQUEST_ID`,`COMMUNICATION_EVENT_ID`),
  KEY `CUSTREQ_CEV_CRQ` (`CUST_REQUEST_ID`),
  KEY `CUSTREQ_CEV_CEV` (`COMMUNICATION_EVENT_ID`),
  KEY `CST_RQT_CMM_EVT_TP` (`LAST_UPDATED_TX_STAMP`),
  KEY `CST_RQT_CMM_EVT_TS` (`CREATED_TX_STAMP`),
  CONSTRAINT `CUSTREQ_CEV_CEV` FOREIGN KEY (`COMMUNICATION_EVENT_ID`) REFERENCES `COMMUNICATION_EVENT` (`COMMUNICATION_EVENT_ID`),
  CONSTRAINT `CUSTREQ_CEV_CRQ` FOREIGN KEY (`CUST_REQUEST_ID`) REFERENCES `CUST_REQUEST` (`CUST_REQUEST_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `CUST_REQUEST_CONTENT`
--

DROP TABLE IF EXISTS `CUST_REQUEST_CONTENT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `CUST_REQUEST_CONTENT` (
  `CUST_REQUEST_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CONTENT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FROM_DATE` datetime NOT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`CUST_REQUEST_ID`,`CONTENT_ID`,`FROM_DATE`),
  KEY `CUSTREQ_CNT_CUSTRQ` (`CUST_REQUEST_ID`),
  KEY `CUSTREQ_CNT_CNT` (`CONTENT_ID`),
  KEY `CST_RQT_CNTT_TXSTP` (`LAST_UPDATED_TX_STAMP`),
  KEY `CST_RQT_CNTT_TXCRS` (`CREATED_TX_STAMP`),
  CONSTRAINT `CUSTREQ_CNT_CNT` FOREIGN KEY (`CONTENT_ID`) REFERENCES `CONTENT` (`CONTENT_ID`),
  CONSTRAINT `CUSTREQ_CNT_CUSTRQ` FOREIGN KEY (`CUST_REQUEST_ID`) REFERENCES `CUST_REQUEST` (`CUST_REQUEST_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `CUST_REQUEST_ITEM`
--

DROP TABLE IF EXISTS `CUST_REQUEST_ITEM`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `CUST_REQUEST_ITEM` (
  `CUST_REQUEST_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CUST_REQUEST_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CUST_REQUEST_RESOLUTION_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `STATUS_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PRIORITY` decimal(20,0) DEFAULT NULL,
  `SEQUENCE_NUM` decimal(20,0) DEFAULT NULL,
  `REQUIRED_BY_DATE` datetime DEFAULT NULL,
  `PRODUCT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `QUANTITY` decimal(18,6) DEFAULT NULL,
  `SELECTED_AMOUNT` decimal(18,6) DEFAULT NULL,
  `MAXIMUM_AMOUNT` decimal(18,2) DEFAULT NULL,
  `RESERV_START` datetime DEFAULT NULL,
  `RESERV_LENGTH` decimal(18,6) DEFAULT NULL,
  `RESERV_PERSONS` decimal(18,6) DEFAULT NULL,
  `CONFIG_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `STORY` 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 (`CUST_REQUEST_ID`,`CUST_REQUEST_ITEM_SEQ_ID`),
  KEY `CUST_REQITM_CREQ` (`CUST_REQUEST_ID`),
  KEY `CUST_REQITM_STTS` (`STATUS_ID`),
  KEY `CUST_REQITM_RES` (`CUST_REQUEST_RESOLUTION_ID`),
  KEY `CUST_REQITM_PRD` (`PRODUCT_ID`),
  KEY `CST_RQT_ITM_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `CST_RQT_ITM_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `CUST_REQITM_CREQ` FOREIGN KEY (`CUST_REQUEST_ID`) REFERENCES `CUST_REQUEST` (`CUST_REQUEST_ID`),
  CONSTRAINT `CUST_REQITM_PRD` FOREIGN KEY (`PRODUCT_ID`) REFERENCES `PRODUCT` (`PRODUCT_ID`),
  CONSTRAINT `CUST_REQITM_RES` FOREIGN KEY (`CUST_REQUEST_RESOLUTION_ID`) REFERENCES `CUST_REQUEST_RESOLUTION` (`CUST_REQUEST_RESOLUTION_ID`),
  CONSTRAINT `CUST_REQITM_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 `CUST_REQUEST_ITEM_NOTE`
--

DROP TABLE IF EXISTS `CUST_REQUEST_ITEM_NOTE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `CUST_REQUEST_ITEM_NOTE` (
  `CUST_REQUEST_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CUST_REQUEST_ITEM_SEQ_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 (`CUST_REQUEST_ID`,`CUST_REQUEST_ITEM_SEQ_ID`,`NOTE_ID`),
  KEY `CUST_REQ_ITNT` (`CUST_REQUEST_ID`,`CUST_REQUEST_ITEM_SEQ_ID`),
  KEY `CUST_REQ_NOTE` (`NOTE_ID`),
  KEY `CST_RQT_ITM_NT_TXP` (`LAST_UPDATED_TX_STAMP`),
  KEY `CST_RQT_ITM_NT_TXS` (`CREATED_TX_STAMP`),
  CONSTRAINT `CUST_REQ_ITNT` FOREIGN KEY (`CUST_REQUEST_ID`, `CUST_REQUEST_ITEM_SEQ_ID`) REFERENCES `CUST_REQUEST_ITEM` (`CUST_REQUEST_ID`, `CUST_REQUEST_ITEM_SEQ_ID`),
  CONSTRAINT `CUST_REQ_NOTE` FOREIGN KEY (`NOTE_ID`) REFERENCES `NOTE_DATA` (`NOTE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `CUST_REQUEST_ITEM_WORK_EFFORT`
--

DROP TABLE IF EXISTS `CUST_REQUEST_ITEM_WORK_EFFORT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `CUST_REQUEST_ITEM_WORK_EFFORT` (
  `CUST_REQUEST_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CUST_REQUEST_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `WORK_EFFORT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`CUST_REQUEST_ID`,`CUST_REQUEST_ITEM_SEQ_ID`,`WORK_EFFORT_ID`),
  KEY `WORK_REQFL_CSTRQ` (`CUST_REQUEST_ID`,`CUST_REQUEST_ITEM_SEQ_ID`),
  KEY `CUST_REQ_WEFF` (`WORK_EFFORT_ID`),
  KEY `CST_ITM_WRK_EFT_TP` (`LAST_UPDATED_TX_STAMP`),
  KEY `CST_ITM_WRK_EFT_TS` (`CREATED_TX_STAMP`),
  CONSTRAINT `CUST_REQ_WEFF` FOREIGN KEY (`WORK_EFFORT_ID`) REFERENCES `WORK_EFFORT` (`WORK_EFFORT_ID`),
  CONSTRAINT `WORK_REQFL_CSTRQ` FOREIGN KEY (`CUST_REQUEST_ID`, `CUST_REQUEST_ITEM_SEQ_ID`) REFERENCES `CUST_REQUEST_ITEM` (`CUST_REQUEST_ID`, `CUST_REQUEST_ITEM_SEQ_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `CUST_REQUEST_NOTE`
--

DROP TABLE IF EXISTS `CUST_REQUEST_NOTE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `CUST_REQUEST_NOTE` (
  `CUST_REQUEST_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 (`CUST_REQUEST_ID`,`NOTE_ID`),
  KEY `CRQ_CR` (`CUST_REQUEST_ID`),
  KEY `CRQ_NOTE` (`NOTE_ID`),
  KEY `CST_RQST_NT_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `CST_RQST_NT_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `CRQ_CR` FOREIGN KEY (`CUST_REQUEST_ID`) REFERENCES `CUST_REQUEST` (`CUST_REQUEST_ID`),
  CONSTRAINT `CRQ_NOTE` FOREIGN KEY (`NOTE_ID`) REFERENCES `NOTE_DATA` (`NOTE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `CUST_REQUEST_PARTY`
--

DROP TABLE IF EXISTS `CUST_REQUEST_PARTY`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `CUST_REQUEST_PARTY` (
  `CUST_REQUEST_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ROLE_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FROM_DATE` datetime NOT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`CUST_REQUEST_ID`,`PARTY_ID`,`ROLE_TYPE_ID`,`FROM_DATE`),
  KEY `CREQ_RL_CRQST` (`CUST_REQUEST_ID`),
  KEY `CREQ_RL_PARTY` (`PARTY_ID`),
  KEY `CREQ_RL_PROLE` (`PARTY_ID`,`ROLE_TYPE_ID`),
  KEY `CST_RQT_PRT_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `CST_RQT_PRT_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `CREQ_RL_CRQST` FOREIGN KEY (`CUST_REQUEST_ID`) REFERENCES `CUST_REQUEST` (`CUST_REQUEST_ID`),
  CONSTRAINT `CREQ_RL_PARTY` FOREIGN KEY (`PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `CREQ_RL_PROLE` FOREIGN KEY (`PARTY_ID`, `ROLE_TYPE_ID`) REFERENCES `PARTY_ROLE` (`PARTY_ID`, `ROLE_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `CUST_REQUEST_RESOLUTION`
--

DROP TABLE IF EXISTS `CUST_REQUEST_RESOLUTION`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `CUST_REQUEST_RESOLUTION` (
  `CUST_REQUEST_RESOLUTION_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CUST_REQUEST_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 (`CUST_REQUEST_RESOLUTION_ID`),
  KEY `CUST_RQRS_TYPE` (`CUST_REQUEST_TYPE_ID`),
  KEY `CST_RQT_RSLN_TXSTP` (`LAST_UPDATED_TX_STAMP`),
  KEY `CST_RQT_RSLN_TXCRS` (`CREATED_TX_STAMP`),
  CONSTRAINT `CUST_RQRS_TYPE` FOREIGN KEY (`CUST_REQUEST_TYPE_ID`) REFERENCES `CUST_REQUEST_TYPE` (`CUST_REQUEST_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `CUST_REQUEST_ROLE`
--

DROP TABLE IF EXISTS `CUST_REQUEST_ROLE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `CUST_REQUEST_ROLE` (
  `CUST_REQUEST_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ROLE_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`CUST_REQUEST_ID`,`PARTY_ID`,`ROLE_TYPE_ID`),
  KEY `CUSTREQ_RL_CRQST` (`CUST_REQUEST_ID`),
  KEY `CUSTREQ_RL_PARTY` (`PARTY_ID`),
  KEY `CUSTREQ_RL_PROLE` (`PARTY_ID`,`ROLE_TYPE_ID`),
  KEY `CST_RQST_RL_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `CST_RQST_RL_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `CUSTREQ_RL_CRQST` FOREIGN KEY (`CUST_REQUEST_ID`) REFERENCES `CUST_REQUEST` (`CUST_REQUEST_ID`),
  CONSTRAINT `CUSTREQ_RL_PARTY` FOREIGN KEY (`PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `CUSTREQ_RL_PROLE` FOREIGN KEY (`PARTY_ID`, `ROLE_TYPE_ID`) REFERENCES `PARTY_ROLE` (`PARTY_ID`, `ROLE_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `CUST_REQUEST_STATUS`
--

DROP TABLE IF EXISTS `CUST_REQUEST_STATUS`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `CUST_REQUEST_STATUS` (
  `CUST_REQUEST_STATUS_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `STATUS_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `CUST_REQUEST_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `CUST_REQUEST_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `STATUS_DATETIME` 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 (`CUST_REQUEST_STATUS_ID`),
  KEY `CUST_REQST_STTS` (`STATUS_ID`),
  KEY `CUST_REQ_STRQ` (`CUST_REQUEST_ID`),
  KEY `CST_RQT_STS_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `CST_RQT_STS_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `CUST_REQST_STTS` FOREIGN KEY (`STATUS_ID`) REFERENCES `STATUS_ITEM` (`STATUS_ID`),
  CONSTRAINT `CUST_REQ_STRQ` FOREIGN KEY (`CUST_REQUEST_ID`) REFERENCES `CUST_REQUEST` (`CUST_REQUEST_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `CUST_REQUEST_TYPE`
--

DROP TABLE IF EXISTS `CUST_REQUEST_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `CUST_REQUEST_TYPE` (
  `CUST_REQUEST_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,
  `PARTY_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 (`CUST_REQUEST_TYPE_ID`),
  KEY `CUST_REQ_TYPE_PAR` (`PARENT_TYPE_ID`),
  KEY `CUST_PTY_PARTY` (`PARTY_ID`),
  KEY `CST_RQST_TP_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `CST_RQST_TP_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `CUST_PTY_PARTY` FOREIGN KEY (`PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `CUST_REQ_TYPE_PAR` FOREIGN KEY (`PARENT_TYPE_ID`) REFERENCES `CUST_REQUEST_TYPE` (`CUST_REQUEST_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `CUST_REQUEST_TYPE_ATTR`
--

DROP TABLE IF EXISTS `CUST_REQUEST_TYPE_ATTR`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `CUST_REQUEST_TYPE_ATTR` (
  `CUST_REQUEST_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 (`CUST_REQUEST_TYPE_ID`,`ATTR_NAME`),
  KEY `CUST_REQ_TYPE_ATTR` (`CUST_REQUEST_TYPE_ID`),
  KEY `CST_RQT_TP_ATR_TXP` (`LAST_UPDATED_TX_STAMP`),
  KEY `CST_RQT_TP_ATR_TXS` (`CREATED_TX_STAMP`),
  CONSTRAINT `CUST_REQ_TYPE_ATTR` FOREIGN KEY (`CUST_REQUEST_TYPE_ID`) REFERENCES `CUST_REQUEST_TYPE` (`CUST_REQUEST_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `CUST_REQUEST_WORK_EFFORT`
--

DROP TABLE IF EXISTS `CUST_REQUEST_WORK_EFFORT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `CUST_REQUEST_WORK_EFFORT` (
  `CUST_REQUEST_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `WORK_EFFORT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`CUST_REQUEST_ID`,`WORK_EFFORT_ID`),
  KEY `CSTREQ_WF_CREQ` (`CUST_REQUEST_ID`),
  KEY `CSTREQ_WF_WEFF` (`WORK_EFFORT_ID`),
  KEY `CST_RQT_WRK_EFT_TP` (`LAST_UPDATED_TX_STAMP`),
  KEY `CST_RQT_WRK_EFT_TS` (`CREATED_TX_STAMP`),
  CONSTRAINT `CSTREQ_WF_CREQ` FOREIGN KEY (`CUST_REQUEST_ID`) REFERENCES `CUST_REQUEST` (`CUST_REQUEST_ID`),
  CONSTRAINT `CSTREQ_WF_WEFF` FOREIGN KEY (`WORK_EFFORT_ID`) REFERENCES `WORK_EFFORT` (`WORK_EFFORT_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `DATA_CATEGORY`
--

DROP TABLE IF EXISTS `DATA_CATEGORY`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `DATA_CATEGORY` (
  `DATA_CATEGORY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARENT_CATEGORY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `CATEGORY_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 (`DATA_CATEGORY_ID`),
  KEY `DATA_CAT_PARENT` (`PARENT_CATEGORY_ID`),
  KEY `DT_CTGR_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `DT_CTGR_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `DATA_CAT_PARENT` FOREIGN KEY (`PARENT_CATEGORY_ID`) REFERENCES `DATA_CATEGORY` (`DATA_CATEGORY_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `DATA_RESOURCE`
--

DROP TABLE IF EXISTS `DATA_RESOURCE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `DATA_RESOURCE` (
  `DATA_RESOURCE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `DATA_RESOURCE_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `DATA_TEMPLATE_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `DATA_CATEGORY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `DATA_SOURCE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `STATUS_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `DATA_RESOURCE_NAME` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `LOCALE_STRING` varchar(10) COLLATE latin1_general_cs DEFAULT NULL,
  `MIME_TYPE_ID` varchar(250) COLLATE latin1_general_cs DEFAULT NULL,
  `CHARACTER_SET_ID` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `OBJECT_INFO` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `SURVEY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SURVEY_RESPONSE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `RELATED_DETAIL_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `IS_PUBLIC` 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 (`DATA_RESOURCE_ID`),
  KEY `DTRSRC_STATUS` (`STATUS_ID`),
  KEY `DATA_REC_TO_TYPE` (`DATA_RESOURCE_TYPE_ID`),
  KEY `DATA_REC_TO_TTP` (`DATA_TEMPLATE_TYPE_ID`),
  KEY `DATA_REC_TO_CAT` (`DATA_CATEGORY_ID`),
  KEY `DATA_REC_DTSRC` (`DATA_SOURCE_ID`),
  KEY `DATA_REC_CHST` (`CHARACTER_SET_ID`),
  KEY `DATA_REC_CB_ULGN` (`CREATED_BY_USER_LOGIN`),
  KEY `DATA_REC_LMB_ULGN` (`LAST_MODIFIED_BY_USER_LOGIN`),
  KEY `DATA_REC_SURVEY` (`SURVEY_ID`),
  KEY `DATA_REC_SVRSP` (`SURVEY_RESPONSE_ID`),
  KEY `DT_RSRC_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `DT_RSRC_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `DATA_REC_CB_ULGN` FOREIGN KEY (`CREATED_BY_USER_LOGIN`) REFERENCES `USER_LOGIN` (`USER_LOGIN_ID`),
  CONSTRAINT `DATA_REC_CHST` FOREIGN KEY (`CHARACTER_SET_ID`) REFERENCES `CHARACTER_SET` (`CHARACTER_SET_ID`),
  CONSTRAINT `DATA_REC_DTSRC` FOREIGN KEY (`DATA_SOURCE_ID`) REFERENCES `DATA_SOURCE` (`DATA_SOURCE_ID`),
  CONSTRAINT `DATA_REC_LMB_ULGN` FOREIGN KEY (`LAST_MODIFIED_BY_USER_LOGIN`) REFERENCES `USER_LOGIN` (`USER_LOGIN_ID`),
  CONSTRAINT `DATA_REC_SURVEY` FOREIGN KEY (`SURVEY_ID`) REFERENCES `SURVEY` (`SURVEY_ID`),
  CONSTRAINT `DATA_REC_SVRSP` FOREIGN KEY (`SURVEY_RESPONSE_ID`) REFERENCES `SURVEY_RESPONSE` (`SURVEY_RESPONSE_ID`),
  CONSTRAINT `DATA_REC_TO_CAT` FOREIGN KEY (`DATA_CATEGORY_ID`) REFERENCES `DATA_CATEGORY` (`DATA_CATEGORY_ID`),
  CONSTRAINT `DATA_REC_TO_TTP` FOREIGN KEY (`DATA_TEMPLATE_TYPE_ID`) REFERENCES `DATA_TEMPLATE_TYPE` (`DATA_TEMPLATE_TYPE_ID`),
  CONSTRAINT `DATA_REC_TO_TYPE` FOREIGN KEY (`DATA_RESOURCE_TYPE_ID`) REFERENCES `DATA_RESOURCE_TYPE` (`DATA_RESOURCE_TYPE_ID`),
  CONSTRAINT `DTRSRC_STATUS` 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 `DATA_RESOURCE_ATTRIBUTE`
--

DROP TABLE IF EXISTS `DATA_RESOURCE_ATTRIBUTE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `DATA_RESOURCE_ATTRIBUTE` (
  `DATA_RESOURCE_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 (`DATA_RESOURCE_ID`,`ATTR_NAME`),
  KEY `DATA_REC_ATTR` (`DATA_RESOURCE_ID`),
  KEY `DT_RSC_ATTRT_TXSTP` (`LAST_UPDATED_TX_STAMP`),
  KEY `DT_RSC_ATTRT_TXCRS` (`CREATED_TX_STAMP`),
  CONSTRAINT `DATA_REC_ATTR` 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 `DATA_RESOURCE_META_DATA`
--

DROP TABLE IF EXISTS `DATA_RESOURCE_META_DATA`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `DATA_RESOURCE_META_DATA` (
  `DATA_RESOURCE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `META_DATA_PREDICATE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `META_DATA_VALUE` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `DATA_SOURCE_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 (`DATA_RESOURCE_ID`,`META_DATA_PREDICATE_ID`),
  KEY `DATA_MD_DATREC` (`DATA_RESOURCE_ID`),
  KEY `DATA_MD_DMDPRD` (`META_DATA_PREDICATE_ID`),
  KEY `DATA_MD_DTSRC` (`DATA_SOURCE_ID`),
  KEY `DT_RSC_MT_DT_TXSTP` (`LAST_UPDATED_TX_STAMP`),
  KEY `DT_RSC_MT_DT_TXCRS` (`CREATED_TX_STAMP`),
  CONSTRAINT `DATA_MD_DATREC` FOREIGN KEY (`DATA_RESOURCE_ID`) REFERENCES `DATA_RESOURCE` (`DATA_RESOURCE_ID`),
  CONSTRAINT `DATA_MD_DMDPRD` FOREIGN KEY (`META_DATA_PREDICATE_ID`) REFERENCES `META_DATA_PREDICATE` (`META_DATA_PREDICATE_ID`),
  CONSTRAINT `DATA_MD_DTSRC` FOREIGN KEY (`DATA_SOURCE_ID`) REFERENCES `DATA_SOURCE` (`DATA_SOURCE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `DATA_RESOURCE_PURPOSE`
--

DROP TABLE IF EXISTS `DATA_RESOURCE_PURPOSE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `DATA_RESOURCE_PURPOSE` (
  `DATA_RESOURCE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CONTENT_PURPOSE_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 (`DATA_RESOURCE_ID`,`CONTENT_PURPOSE_TYPE_ID`),
  KEY `DATA_REC_PRP` (`DATA_RESOURCE_ID`),
  KEY `DATA_REC_PRP_TYPE` (`CONTENT_PURPOSE_TYPE_ID`),
  KEY `DT_RSRC_PRS_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `DT_RSRC_PRS_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `DATA_REC_PRP` FOREIGN KEY (`DATA_RESOURCE_ID`) REFERENCES `DATA_RESOURCE` (`DATA_RESOURCE_ID`),
  CONSTRAINT `DATA_REC_PRP_TYPE` FOREIGN KEY (`CONTENT_PURPOSE_TYPE_ID`) REFERENCES `CONTENT_PURPOSE_TYPE` (`CONTENT_PURPOSE_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `DATA_RESOURCE_ROLE`
--

DROP TABLE IF EXISTS `DATA_RESOURCE_ROLE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `DATA_RESOURCE_ROLE` (
  `DATA_RESOURCE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ROLE_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FROM_DATE` datetime NOT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`DATA_RESOURCE_ID`,`PARTY_ID`,`ROLE_TYPE_ID`,`FROM_DATE`),
  KEY `DATARECRL_DATREC` (`DATA_RESOURCE_ID`),
  KEY `DATARECRL_PTRL` (`PARTY_ID`,`ROLE_TYPE_ID`),
  KEY `DT_RSRC_RL_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `DT_RSRC_RL_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `DATARECRL_DATREC` FOREIGN KEY (`DATA_RESOURCE_ID`) REFERENCES `DATA_RESOURCE` (`DATA_RESOURCE_ID`),
  CONSTRAINT `DATARECRL_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 `DATA_RESOURCE_TYPE`
--

DROP TABLE IF EXISTS `DATA_RESOURCE_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `DATA_RESOURCE_TYPE` (
  `DATA_RESOURCE_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 (`DATA_RESOURCE_TYPE_ID`),
  KEY `DATA_OBTYPE_PARENT` (`PARENT_TYPE_ID`),
  KEY `DT_RSRC_TP_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `DT_RSRC_TP_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `DATA_OBTYPE_PARENT` FOREIGN KEY (`PARENT_TYPE_ID`) REFERENCES `DATA_RESOURCE_TYPE` (`DATA_RESOURCE_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `DATA_RESOURCE_TYPE_ATTR`
--

DROP TABLE IF EXISTS `DATA_RESOURCE_TYPE_ATTR`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `DATA_RESOURCE_TYPE_ATTR` (
  `DATA_RESOURCE_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 (`DATA_RESOURCE_TYPE_ID`,`ATTR_NAME`),
  KEY `DATA_OBTYPE_ATTR` (`DATA_RESOURCE_TYPE_ID`),
  KEY `DT_RSC_TP_ATR_TXSP` (`LAST_UPDATED_TX_STAMP`),
  KEY `DT_RSC_TP_ATR_TXCS` (`CREATED_TX_STAMP`),
  CONSTRAINT `DATA_OBTYPE_ATTR` FOREIGN KEY (`DATA_RESOURCE_TYPE_ID`) REFERENCES `DATA_RESOURCE_TYPE` (`DATA_RESOURCE_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `DATA_SOURCE`
--

DROP TABLE IF EXISTS `DATA_SOURCE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `DATA_SOURCE` (
  `DATA_SOURCE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `DATA_SOURCE_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 (`DATA_SOURCE_ID`),
  KEY `DATA_SRC_TYP` (`DATA_SOURCE_TYPE_ID`),
  KEY `DATA_SOURCE_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `DATA_SOURCE_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `DATA_SRC_TYP` FOREIGN KEY (`DATA_SOURCE_TYPE_ID`) REFERENCES `DATA_SOURCE_TYPE` (`DATA_SOURCE_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `DATA_SOURCE_TYPE`
--

DROP TABLE IF EXISTS `DATA_SOURCE_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `DATA_SOURCE_TYPE` (
  `DATA_SOURCE_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 (`DATA_SOURCE_TYPE_ID`),
  KEY `DT_SRC_TP_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `DT_SRC_TP_TXCRTS` (`CREATED_TX_STAMP`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `DATA_TEMPLATE_TYPE`
--

DROP TABLE IF EXISTS `DATA_TEMPLATE_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `DATA_TEMPLATE_TYPE` (
  `DATA_TEMPLATE_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `EXTENSION` 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 (`DATA_TEMPLATE_TYPE_ID`),
  KEY `DT_TMPLT_TP_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `DT_TMPLT_TP_TXCRTS` (`CREATED_TX_STAMP`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `DEDUCTION`
--

DROP TABLE IF EXISTS `DEDUCTION`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `DEDUCTION` (
  `DEDUCTION_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `DEDUCTION_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PAYMENT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `AMOUNT` decimal(18,2) DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`DEDUCTION_ID`),
  KEY `DEDCTN_DEDTYP` (`DEDUCTION_TYPE_ID`),
  KEY `DEDCTN_PMNT` (`PAYMENT_ID`),
  KEY `DEDUCTION_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `DEDUCTION_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `DEDCTN_DEDTYP` FOREIGN KEY (`DEDUCTION_TYPE_ID`) REFERENCES `DEDUCTION_TYPE` (`DEDUCTION_TYPE_ID`),
  CONSTRAINT `DEDCTN_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 `DEDUCTION_TYPE`
--

DROP TABLE IF EXISTS `DEDUCTION_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `DEDUCTION_TYPE` (
  `DEDUCTION_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 (`DEDUCTION_TYPE_ID`),
  KEY `DDCTN_TP_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `DDCTN_TP_TXCRTS` (`CREATED_TX_STAMP`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `DELIVERABLE`
--

DROP TABLE IF EXISTS `DELIVERABLE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `DELIVERABLE` (
  `DELIVERABLE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `DELIVERABLE_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `DELIVERABLE_NAME` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`DELIVERABLE_ID`),
  KEY `DELIVERABLE_DLTYP` (`DELIVERABLE_TYPE_ID`),
  KEY `DELIVERABLE_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `DELIVERABLE_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `DELIVERABLE_DLTYP` FOREIGN KEY (`DELIVERABLE_TYPE_ID`) REFERENCES `DELIVERABLE_TYPE` (`DELIVERABLE_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `DELIVERABLE_TYPE`
--

DROP TABLE IF EXISTS `DELIVERABLE_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `DELIVERABLE_TYPE` (
  `DELIVERABLE_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 (`DELIVERABLE_TYPE_ID`),
  KEY `DLVRBL_TP_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `DLVRBL_TP_TXCRTS` (`CREATED_TX_STAMP`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `DELIVERY`
--

DROP TABLE IF EXISTS `DELIVERY`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `DELIVERY` (
  `DELIVERY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ORIGIN_FACILITY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `DEST_FACILITY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ACTUAL_START_DATE` datetime DEFAULT NULL,
  `ACTUAL_ARRIVAL_DATE` datetime DEFAULT NULL,
  `ESTIMATED_START_DATE` datetime DEFAULT NULL,
  `ESTIMATED_ARRIVAL_DATE` datetime DEFAULT NULL,
  `FIXED_ASSET_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `START_MILEAGE` decimal(18,6) DEFAULT NULL,
  `END_MILEAGE` decimal(18,6) DEFAULT NULL,
  `FUEL_USED` 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 (`DELIVERY_ID`),
  KEY `DELIV_FXAS` (`FIXED_ASSET_ID`),
  KEY `DELIV_OFAC` (`ORIGIN_FACILITY_ID`),
  KEY `DELIV_DFAC` (`DEST_FACILITY_ID`),
  KEY `DELIVERY_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `DELIVERY_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `DELIV_DFAC` FOREIGN KEY (`DEST_FACILITY_ID`) REFERENCES `FACILITY` (`FACILITY_ID`),
  CONSTRAINT `DELIV_FXAS` FOREIGN KEY (`FIXED_ASSET_ID`) REFERENCES `FIXED_ASSET` (`FIXED_ASSET_ID`),
  CONSTRAINT `DELIV_OFAC` FOREIGN KEY (`ORIGIN_FACILITY_ID`) REFERENCES `FACILITY` (`FACILITY_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `DESIRED_FEATURE`
--

DROP TABLE IF EXISTS `DESIRED_FEATURE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `DESIRED_FEATURE` (
  `DESIRED_FEATURE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `REQUIREMENT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_FEATURE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `OPTIONAL_IND` 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 (`DESIRED_FEATURE_ID`,`REQUIREMENT_ID`),
  KEY `DES_FEAT_REQ` (`REQUIREMENT_ID`),
  KEY `DES_FEAT_PFEAT` (`PRODUCT_FEATURE_ID`),
  KEY `DSRD_FTR_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `DSRD_FTR_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `DES_FEAT_PFEAT` FOREIGN KEY (`PRODUCT_FEATURE_ID`) REFERENCES `PRODUCT_FEATURE` (`PRODUCT_FEATURE_ID`),
  CONSTRAINT `DES_FEAT_REQ` FOREIGN KEY (`REQUIREMENT_ID`) REFERENCES `REQUIREMENT` (`REQUIREMENT_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `DOCUMENT`
--

DROP TABLE IF EXISTS `DOCUMENT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `DOCUMENT` (
  `DOCUMENT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `DOCUMENT_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `DATE_CREATED` datetime DEFAULT NULL,
  `COMMENTS` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `DOCUMENT_LOCATION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `DOCUMENT_TEXT` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `IMAGE_DATA` longblob,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`DOCUMENT_ID`),
  KEY `DOCUMENT_TO_TYPE` (`DOCUMENT_TYPE_ID`),
  KEY `DOCUMENT_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `DOCUMENT_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `DOCUMENT_TO_TYPE` FOREIGN KEY (`DOCUMENT_TYPE_ID`) REFERENCES `DOCUMENT_TYPE` (`DOCUMENT_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `DOCUMENT_ATTRIBUTE`
--

DROP TABLE IF EXISTS `DOCUMENT_ATTRIBUTE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `DOCUMENT_ATTRIBUTE` (
  `DOCUMENT_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 (`DOCUMENT_ID`,`ATTR_NAME`),
  KEY `DOCUMENT_ATTR` (`DOCUMENT_ID`),
  KEY `DCMNT_ATTRT_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `DCMNT_ATTRT_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `DOCUMENT_ATTR` FOREIGN KEY (`DOCUMENT_ID`) REFERENCES `DOCUMENT` (`DOCUMENT_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `DOCUMENT_TYPE`
--

DROP TABLE IF EXISTS `DOCUMENT_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `DOCUMENT_TYPE` (
  `DOCUMENT_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 (`DOCUMENT_TYPE_ID`),
  KEY `DOC_TYPE_PARENT` (`PARENT_TYPE_ID`),
  KEY `DCMNT_TP_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `DCMNT_TP_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `DOC_TYPE_PARENT` FOREIGN KEY (`PARENT_TYPE_ID`) REFERENCES `DOCUMENT_TYPE` (`DOCUMENT_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `DOCUMENT_TYPE_ATTR`
--

DROP TABLE IF EXISTS `DOCUMENT_TYPE_ATTR`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `DOCUMENT_TYPE_ATTR` (
  `DOCUMENT_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 (`DOCUMENT_TYPE_ID`,`ATTR_NAME`),
  KEY `DOC_TYPE_ATTR` (`DOCUMENT_TYPE_ID`),
  KEY `DCMT_TP_ATR_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `DCMT_TP_ATR_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `DOC_TYPE_ATTR` FOREIGN KEY (`DOCUMENT_TYPE_ID`) REFERENCES `DOCUMENT_TYPE` (`DOCUMENT_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `EFT_ACCOUNT`
--

DROP TABLE IF EXISTS `EFT_ACCOUNT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `EFT_ACCOUNT` (
  `PAYMENT_METHOD_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `BANK_NAME` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `ROUTING_NUMBER` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `ACCOUNT_TYPE` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `ACCOUNT_NUMBER` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `NAME_ON_ACCOUNT` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `COMPANY_NAME_ON_ACCOUNT` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `CONTACT_MECH_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `YEARS_AT_BANK` 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_METHOD_ID`),
  KEY `EFTACCT_PMETH` (`PAYMENT_METHOD_ID`),
  KEY `EFTACCT_CMECH` (`CONTACT_MECH_ID`),
  KEY `EFTACCT_PADDR` (`CONTACT_MECH_ID`),
  KEY `EFT_ACCOUNT_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `EFT_ACCOUNT_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `EFTACCT_CMECH` FOREIGN KEY (`CONTACT_MECH_ID`) REFERENCES `CONTACT_MECH` (`CONTACT_MECH_ID`),
  CONSTRAINT `EFTACCT_PADDR` FOREIGN KEY (`CONTACT_MECH_ID`) REFERENCES `POSTAL_ADDRESS` (`CONTACT_MECH_ID`),
  CONSTRAINT `EFTACCT_PMETH` 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 `ELECTRONIC_TEXT`
--

DROP TABLE IF EXISTS `ELECTRONIC_TEXT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ELECTRONIC_TEXT` (
  `DATA_RESOURCE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `TEXT_DATA` 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 (`DATA_RESOURCE_ID`),
  KEY `DATA_REC_TEXT` (`DATA_RESOURCE_ID`),
  KEY `ELCTRNC_TXT_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `ELCTRNC_TXT_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `DATA_REC_TEXT` 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 `EMAIL_ADDRESS_VERIFICATION`
--

DROP TABLE IF EXISTS `EMAIL_ADDRESS_VERIFICATION`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `EMAIL_ADDRESS_VERIFICATION` (
  `EMAIL_ADDRESS` varchar(250) COLLATE latin1_general_cs NOT NULL,
  `VERIFY_HASH` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `EXPIRE_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 (`EMAIL_ADDRESS`),
  UNIQUE KEY `EMAIL_VERIFY_HASH` (`VERIFY_HASH`),
  KEY `EML_ADDS_VRFN_TXSP` (`LAST_UPDATED_TX_STAMP`),
  KEY `EML_ADDS_VRFN_TXCS` (`CREATED_TX_STAMP`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `EMAIL_TEMPLATE_SETTING`
--

DROP TABLE IF EXISTS `EMAIL_TEMPLATE_SETTING`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `EMAIL_TEMPLATE_SETTING` (
  `EMAIL_TEMPLATE_SETTING_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `BODY_SCREEN_LOCATION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `XSLFO_ATTACH_SCREEN_LOCATION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `FROM_ADDRESS` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `CC_ADDRESS` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `BCC_ADDRESS` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `SUBJECT` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `CONTENT_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 (`EMAIL_TEMPLATE_SETTING_ID`),
  KEY `EML_TMPT_STG_TXSTP` (`LAST_UPDATED_TX_STAMP`),
  KEY `EML_TMPT_STG_TXCRS` (`CREATED_TX_STAMP`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `EMPLOYMENT`
--

DROP TABLE IF EXISTS `EMPLOYMENT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `EMPLOYMENT` (
  `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,
  `TERMINATION_REASON_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `TERMINATION_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 (`ROLE_TYPE_ID_FROM`,`ROLE_TYPE_ID_TO`,`PARTY_ID_FROM`,`PARTY_ID_TO`,`FROM_DATE`),
  KEY `EMPLMNT_TPTY` (`PARTY_ID_TO`),
  KEY `EMPLMNT_TPTRL` (`PARTY_ID_TO`,`ROLE_TYPE_ID_TO`),
  KEY `EMPLMNT_FPTY` (`PARTY_ID_FROM`),
  KEY `EMPLMNT_FPTRL` (`PARTY_ID_FROM`,`ROLE_TYPE_ID_FROM`),
  KEY `EMPLOYMENT_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `EMPLOYMENT_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `EMPLMNT_FPTRL` FOREIGN KEY (`PARTY_ID_FROM`, `ROLE_TYPE_ID_FROM`) REFERENCES `PARTY_ROLE` (`PARTY_ID`, `ROLE_TYPE_ID`),
  CONSTRAINT `EMPLMNT_FPTY` FOREIGN KEY (`PARTY_ID_FROM`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `EMPLMNT_TPTRL` FOREIGN KEY (`PARTY_ID_TO`, `ROLE_TYPE_ID_TO`) REFERENCES `PARTY_ROLE` (`PARTY_ID`, `ROLE_TYPE_ID`),
  CONSTRAINT `EMPLMNT_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 `EMPLOYMENT_APP`
--

DROP TABLE IF EXISTS `EMPLOYMENT_APP`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `EMPLOYMENT_APP` (
  `APPLICATION_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `EMPL_POSITION_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `STATUS_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `EMPLOYMENT_APP_SOURCE_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `APPLYING_PARTY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `REFERRED_BY_PARTY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `APPLICATION_DATE` datetime DEFAULT NULL,
  `APPROVER_PARTY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `JOB_REQUISITION_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 (`APPLICATION_ID`),
  KEY `EMPLMNT_APP_APER` (`APPROVER_PARTY_ID`),
  KEY `EMPLMNT_APP_JBRQ` (`JOB_REQUISITION_ID`),
  KEY `EMPLMNT_APP_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `EMPLMNT_APP_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `EMPLMNT_APP_APER` FOREIGN KEY (`APPROVER_PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `EMPLMNT_APP_JBRQ` FOREIGN KEY (`JOB_REQUISITION_ID`) REFERENCES `JOB_REQUISITION` (`JOB_REQUISITION_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `EMPLOYMENT_APP_SOURCE_TYPE`
--

DROP TABLE IF EXISTS `EMPLOYMENT_APP_SOURCE_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `EMPLOYMENT_APP_SOURCE_TYPE` (
  `EMPLOYMENT_APP_SOURCE_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 (`EMPLOYMENT_APP_SOURCE_TYPE_ID`),
  KEY `EMPL_APP_SRC_TYP` (`PARENT_TYPE_ID`),
  KEY `EMT_APP_SRC_TP_TXP` (`LAST_UPDATED_TX_STAMP`),
  KEY `EMT_APP_SRC_TP_TXS` (`CREATED_TX_STAMP`),
  CONSTRAINT `EMPL_APP_SRC_TYP` FOREIGN KEY (`PARENT_TYPE_ID`) REFERENCES `EMPLOYMENT_APP_SOURCE_TYPE` (`EMPLOYMENT_APP_SOURCE_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `EMPL_LEAVE`
--

DROP TABLE IF EXISTS `EMPL_LEAVE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `EMPL_LEAVE` (
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `LEAVE_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `EMPL_LEAVE_REASON_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `FROM_DATE` datetime NOT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `APPROVER_PARTY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `LEAVE_STATUS` 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_ID`,`LEAVE_TYPE_ID`,`FROM_DATE`),
  KEY `EMPL_LEAVE_PRTY` (`PARTY_ID`),
  KEY `EMPL_LEAVE_ELETP` (`LEAVE_TYPE_ID`),
  KEY `EMP_LEAV_REAS_ELTP` (`EMPL_LEAVE_REASON_TYPE_ID`),
  KEY `EMPL_LEAVE_APPR` (`APPROVER_PARTY_ID`),
  KEY `EMPL_LEAVE_STS` (`LEAVE_STATUS`),
  KEY `EMPL_LEAVE_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `EMPL_LEAVE_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `EMPL_LEAVE_APPR` FOREIGN KEY (`APPROVER_PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `EMPL_LEAVE_ELETP` FOREIGN KEY (`LEAVE_TYPE_ID`) REFERENCES `EMPL_LEAVE_TYPE` (`LEAVE_TYPE_ID`),
  CONSTRAINT `EMPL_LEAVE_PRTY` FOREIGN KEY (`PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `EMPL_LEAVE_STS` FOREIGN KEY (`LEAVE_STATUS`) REFERENCES `STATUS_ITEM` (`STATUS_ID`),
  CONSTRAINT `EMP_LEAV_REAS_ELTP` FOREIGN KEY (`EMPL_LEAVE_REASON_TYPE_ID`) REFERENCES `EMPL_LEAVE_REASON_TYPE` (`EMPL_LEAVE_REASON_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `EMPL_LEAVE_REASON_TYPE`
--

DROP TABLE IF EXISTS `EMPL_LEAVE_REASON_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `EMPL_LEAVE_REASON_TYPE` (
  `EMPL_LEAVE_REASON_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 (`EMPL_LEAVE_REASON_TYPE_ID`),
  KEY `EMPL_REASON_TPAR` (`PARENT_TYPE_ID`),
  KEY `EML_LV_RSN_TP_TXSP` (`LAST_UPDATED_TX_STAMP`),
  KEY `EML_LV_RSN_TP_TXCS` (`CREATED_TX_STAMP`),
  CONSTRAINT `EMPL_REASON_TPAR` FOREIGN KEY (`PARENT_TYPE_ID`) REFERENCES `EMPL_LEAVE_REASON_TYPE` (`EMPL_LEAVE_REASON_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `EMPL_LEAVE_TYPE`
--

DROP TABLE IF EXISTS `EMPL_LEAVE_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `EMPL_LEAVE_TYPE` (
  `LEAVE_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 (`LEAVE_TYPE_ID`),
  KEY `EMPL_LEAVE_TPAR` (`PARENT_TYPE_ID`),
  KEY `EMPL_LV_TP_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `EMPL_LV_TP_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `EMPL_LEAVE_TPAR` FOREIGN KEY (`PARENT_TYPE_ID`) REFERENCES `EMPL_LEAVE_TYPE` (`LEAVE_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `EMPL_POSITION`
--

DROP TABLE IF EXISTS `EMPL_POSITION`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `EMPL_POSITION` (
  `EMPL_POSITION_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `STATUS_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `BUDGET_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `BUDGET_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `EMPL_POSITION_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ESTIMATED_FROM_DATE` datetime DEFAULT NULL,
  `ESTIMATED_THRU_DATE` datetime DEFAULT NULL,
  `SALARY_FLAG` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `EXEMPT_FLAG` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `FULLTIME_FLAG` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `TEMPORARY_FLAG` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `ACTUAL_FROM_DATE` datetime DEFAULT NULL,
  `ACTUAL_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 (`EMPL_POSITION_ID`),
  KEY `EMPL_POS_STTS` (`STATUS_ID`),
  KEY `EMPL_POS_PRTY` (`PARTY_ID`),
  KEY `EMPL_PSTN_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `EMPL_PSTN_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `EMPL_POS_PRTY` FOREIGN KEY (`PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `EMPL_POS_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 `EMPL_POSITION_CLASS_TYPE`
--

DROP TABLE IF EXISTS `EMPL_POSITION_CLASS_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `EMPL_POSITION_CLASS_TYPE` (
  `EMPL_POSITION_CLASS_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 (`EMPL_POSITION_CLASS_TYPE_ID`),
  KEY `EMPL_CLS_TYP_PAR` (`PARENT_TYPE_ID`),
  KEY `EML_PSN_CLS_TP_TXP` (`LAST_UPDATED_TX_STAMP`),
  KEY `EML_PSN_CLS_TP_TXS` (`CREATED_TX_STAMP`),
  CONSTRAINT `EMPL_CLS_TYP_PAR` FOREIGN KEY (`PARENT_TYPE_ID`) REFERENCES `EMPL_POSITION_CLASS_TYPE` (`EMPL_POSITION_CLASS_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `EMPL_POSITION_FULFILLMENT`
--

DROP TABLE IF EXISTS `EMPL_POSITION_FULFILLMENT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `EMPL_POSITION_FULFILLMENT` (
  `EMPL_POSITION_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARTY_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 (`EMPL_POSITION_ID`,`PARTY_ID`,`FROM_DATE`),
  KEY `EMPL_PSFLMT_EMPS` (`EMPL_POSITION_ID`),
  KEY `EMPL_PSFLMT_PRTY` (`PARTY_ID`),
  KEY `EML_PSN_FLFLT_TXSP` (`LAST_UPDATED_TX_STAMP`),
  KEY `EML_PSN_FLFLT_TXCS` (`CREATED_TX_STAMP`),
  CONSTRAINT `EMPL_PSFLMT_EMPS` FOREIGN KEY (`EMPL_POSITION_ID`) REFERENCES `EMPL_POSITION` (`EMPL_POSITION_ID`),
  CONSTRAINT `EMPL_PSFLMT_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 `EMPL_POSITION_REPORTING_STRUCT`
--

DROP TABLE IF EXISTS `EMPL_POSITION_REPORTING_STRUCT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `EMPL_POSITION_REPORTING_STRUCT` (
  `EMPL_POSITION_ID_REPORTING_TO` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `EMPL_POSITION_ID_MANAGED_BY` 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,
  `PRIMARY_FLAG` 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 (`EMPL_POSITION_ID_REPORTING_TO`,`EMPL_POSITION_ID_MANAGED_BY`,`FROM_DATE`),
  KEY `EMPL_PSRPS_EMPSR` (`EMPL_POSITION_ID_REPORTING_TO`),
  KEY `EMPL_PSRPS_EMPSM` (`EMPL_POSITION_ID_MANAGED_BY`),
  KEY `EML_PSN_RPG_STT_TP` (`LAST_UPDATED_TX_STAMP`),
  KEY `EML_PSN_RPG_STT_TS` (`CREATED_TX_STAMP`),
  CONSTRAINT `EMPL_PSRPS_EMPSM` FOREIGN KEY (`EMPL_POSITION_ID_MANAGED_BY`) REFERENCES `EMPL_POSITION` (`EMPL_POSITION_ID`),
  CONSTRAINT `EMPL_PSRPS_EMPSR` FOREIGN KEY (`EMPL_POSITION_ID_REPORTING_TO`) REFERENCES `EMPL_POSITION` (`EMPL_POSITION_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `EMPL_POSITION_RESPONSIBILITY`
--

DROP TABLE IF EXISTS `EMPL_POSITION_RESPONSIBILITY`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `EMPL_POSITION_RESPONSIBILITY` (
  `EMPL_POSITION_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `RESPONSIBILITY_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 (`EMPL_POSITION_ID`,`RESPONSIBILITY_TYPE_ID`,`FROM_DATE`),
  KEY `EMPL_PSRTY_EMPS` (`EMPL_POSITION_ID`),
  KEY `EMPL_PSRTY_RYTP` (`RESPONSIBILITY_TYPE_ID`),
  KEY `EML_PSN_RSPNT_TXSP` (`LAST_UPDATED_TX_STAMP`),
  KEY `EML_PSN_RSPNT_TXCS` (`CREATED_TX_STAMP`),
  CONSTRAINT `EMPL_PSRTY_EMPS` FOREIGN KEY (`EMPL_POSITION_ID`) REFERENCES `EMPL_POSITION` (`EMPL_POSITION_ID`),
  CONSTRAINT `EMPL_PSRTY_RYTP` FOREIGN KEY (`RESPONSIBILITY_TYPE_ID`) REFERENCES `RESPONSIBILITY_TYPE` (`RESPONSIBILITY_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `EMPL_POSITION_TYPE`
--

DROP TABLE IF EXISTS `EMPL_POSITION_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `EMPL_POSITION_TYPE` (
  `EMPL_POSITION_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 (`EMPL_POSITION_TYPE_ID`),
  KEY `EMPL_POSI_TYP_PAR` (`PARENT_TYPE_ID`),
  KEY `EMPL_PSN_TP_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `EMPL_PSN_TP_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `EMPL_POSI_TYP_PAR` FOREIGN KEY (`PARENT_TYPE_ID`) REFERENCES `EMPL_POSITION_TYPE` (`EMPL_POSITION_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `EMPL_POSITION_TYPE_CLASS`
--

DROP TABLE IF EXISTS `EMPL_POSITION_TYPE_CLASS`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `EMPL_POSITION_TYPE_CLASS` (
  `EMPL_POSITION_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `EMPL_POSITION_CLASS_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FROM_DATE` datetime NOT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `STANDARD_HOURS_PER_WEEK` double DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`EMPL_POSITION_TYPE_ID`,`EMPL_POSITION_CLASS_TYPE_ID`,`FROM_DATE`),
  KEY `EMPL_PSTPCS_EPTP` (`EMPL_POSITION_TYPE_ID`),
  KEY `EMPL_PSTPCS_EPCTP` (`EMPL_POSITION_CLASS_TYPE_ID`),
  KEY `EML_PSN_TP_CLS_TXP` (`LAST_UPDATED_TX_STAMP`),
  KEY `EML_PSN_TP_CLS_TXS` (`CREATED_TX_STAMP`),
  CONSTRAINT `EMPL_PSTPCS_EPCTP` FOREIGN KEY (`EMPL_POSITION_CLASS_TYPE_ID`) REFERENCES `EMPL_POSITION_CLASS_TYPE` (`EMPL_POSITION_CLASS_TYPE_ID`),
  CONSTRAINT `EMPL_PSTPCS_EPTP` FOREIGN KEY (`EMPL_POSITION_TYPE_ID`) REFERENCES `EMPL_POSITION_TYPE` (`EMPL_POSITION_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `EMPL_POSITION_TYPE_RATE`
--

DROP TABLE IF EXISTS `EMPL_POSITION_TYPE_RATE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `EMPL_POSITION_TYPE_RATE` (
  `EMPL_POSITION_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PERIOD_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PAY_GRADE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SALARY_STEP_SEQ_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `RATE_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `FROM_DATE` datetime NOT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `RATE` 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 (`EMPL_POSITION_TYPE_ID`,`PERIOD_TYPE_ID`,`FROM_DATE`),
  KEY `EMPL_PSTPRT_EPTP` (`EMPL_POSITION_TYPE_ID`),
  KEY `EMPL_PSTPRT_PRDTYP` (`PERIOD_TYPE_ID`),
  KEY `EML_PSN_TP_RT_TXSP` (`LAST_UPDATED_TX_STAMP`),
  KEY `EML_PSN_TP_RT_TXCS` (`CREATED_TX_STAMP`),
  CONSTRAINT `EMPL_PSTPRT_EPTP` FOREIGN KEY (`EMPL_POSITION_TYPE_ID`) REFERENCES `EMPL_POSITION_TYPE` (`EMPL_POSITION_TYPE_ID`),
  CONSTRAINT `EMPL_PSTPRT_PRDTYP` FOREIGN KEY (`PERIOD_TYPE_ID`) REFERENCES `PERIOD_TYPE` (`PERIOD_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `EMPL_POSITION_TYPE_RATE_NEW`
--

DROP TABLE IF EXISTS `EMPL_POSITION_TYPE_RATE_NEW`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `EMPL_POSITION_TYPE_RATE_NEW` (
  `EMPL_POSITION_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `RATE_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PAY_GRADE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SALARY_STEP_SEQ_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 (`EMPL_POSITION_TYPE_ID`,`RATE_TYPE_ID`,`FROM_DATE`),
  KEY `EMPL_PTPRT_EPTP` (`EMPL_POSITION_TYPE_ID`),
  KEY `EML_TP_RT_NW_TP` (`LAST_UPDATED_TX_STAMP`),
  KEY `EML_TP_RT_NW_TS` (`CREATED_TX_STAMP`),
  CONSTRAINT `EMPL_PTPRT_EPTP` FOREIGN KEY (`EMPL_POSITION_TYPE_ID`) REFERENCES `EMPL_POSITION_TYPE` (`EMPL_POSITION_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ENTITY_AUDIT_LOG`
--

DROP TABLE IF EXISTS `ENTITY_AUDIT_LOG`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ENTITY_AUDIT_LOG` (
  `AUDIT_HISTORY_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CHANGED_ENTITY_NAME` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `CHANGED_FIELD_NAME` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `PK_COMBINED_VALUE_TEXT` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `OLD_VALUE_TEXT` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `NEW_VALUE_TEXT` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `CHANGED_DATE` datetime DEFAULT NULL,
  `CHANGED_BY_INFO` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `CHANGED_SESSION_INFO` 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 (`AUDIT_HISTORY_SEQ_ID`),
  KEY `ENTT_ADT_LG_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `ENTT_ADT_LG_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 `ENTITY_GROUP`
--

DROP TABLE IF EXISTS `ENTITY_GROUP`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ENTITY_GROUP` (
  `ENTITY_GROUP_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ENTITY_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 (`ENTITY_GROUP_ID`),
  KEY `ENTT_GRP_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `ENTT_GRP_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 `ENTITY_GROUP_ENTRY`
--

DROP TABLE IF EXISTS `ENTITY_GROUP_ENTRY`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ENTITY_GROUP_ENTRY` (
  `ENTITY_GROUP_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ENTITY_OR_PACKAGE` varchar(255) COLLATE latin1_general_cs NOT NULL,
  `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 (`ENTITY_GROUP_ID`,`ENTITY_OR_PACKAGE`),
  KEY `ENTGRP_GRP` (`ENTITY_GROUP_ID`),
  KEY `ENT_GRP_ENR_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `ENT_GRP_ENR_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `ENTGRP_GRP` FOREIGN KEY (`ENTITY_GROUP_ID`) REFERENCES `ENTITY_GROUP` (`ENTITY_GROUP_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ENTITY_KEY_STORE`
--

DROP TABLE IF EXISTS `ENTITY_KEY_STORE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ENTITY_KEY_STORE` (
  `KEY_NAME` varchar(250) COLLATE latin1_general_cs NOT NULL,
  `KEY_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 (`KEY_NAME`),
  KEY `ENTT_K_STR_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `ENTT_K_STR_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 `ENTITY_SYNC`
--

DROP TABLE IF EXISTS `ENTITY_SYNC`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ENTITY_SYNC` (
  `ENTITY_SYNC_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `RUN_STATUS_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_SUCCESSFUL_SYNCH_TIME` datetime DEFAULT NULL,
  `LAST_HISTORY_START_DATE` datetime DEFAULT NULL,
  `PRE_OFFLINE_SYNCH_TIME` datetime DEFAULT NULL,
  `OFFLINE_SYNC_SPLIT_MILLIS` decimal(20,0) DEFAULT NULL,
  `SYNC_SPLIT_MILLIS` decimal(20,0) DEFAULT NULL,
  `SYNC_END_BUFFER_MILLIS` decimal(20,0) DEFAULT NULL,
  `MAX_RUNNING_NO_UPDATE_MILLIS` decimal(20,0) DEFAULT NULL,
  `TARGET_SERVICE_NAME` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `TARGET_DELEGATOR_NAME` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `KEEP_REMOVE_INFO_HOURS` double DEFAULT NULL,
  `FOR_PULL_ONLY` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `FOR_PUSH_ONLY` 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 (`ENTITY_SYNC_ID`),
  KEY `ENTITY_SYNC_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `ENTITY_SYNC_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 `ENTITY_SYNC_HISTORY`
--

DROP TABLE IF EXISTS `ENTITY_SYNC_HISTORY`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ENTITY_SYNC_HISTORY` (
  `ENTITY_SYNC_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `START_DATE` datetime NOT NULL,
  `RUN_STATUS_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `BEGINNING_SYNCH_TIME` datetime DEFAULT NULL,
  `LAST_SUCCESSFUL_SYNCH_TIME` datetime DEFAULT NULL,
  `LAST_CANDIDATE_END_TIME` datetime DEFAULT NULL,
  `LAST_SPLIT_START_TIME` decimal(20,0) DEFAULT NULL,
  `TO_CREATE_INSERTED` decimal(20,0) DEFAULT NULL,
  `TO_CREATE_UPDATED` decimal(20,0) DEFAULT NULL,
  `TO_CREATE_NOT_UPDATED` decimal(20,0) DEFAULT NULL,
  `TO_STORE_INSERTED` decimal(20,0) DEFAULT NULL,
  `TO_STORE_UPDATED` decimal(20,0) DEFAULT NULL,
  `TO_STORE_NOT_UPDATED` decimal(20,0) DEFAULT NULL,
  `TO_REMOVE_DELETED` decimal(20,0) DEFAULT NULL,
  `TO_REMOVE_ALREADY_DELETED` decimal(20,0) DEFAULT NULL,
  `TOTAL_ROWS_EXPORTED` decimal(20,0) DEFAULT NULL,
  `TOTAL_ROWS_TO_CREATE` decimal(20,0) DEFAULT NULL,
  `TOTAL_ROWS_TO_STORE` decimal(20,0) DEFAULT NULL,
  `TOTAL_ROWS_TO_REMOVE` decimal(20,0) DEFAULT NULL,
  `TOTAL_SPLITS` decimal(20,0) DEFAULT NULL,
  `TOTAL_STORE_CALLS` decimal(20,0) DEFAULT NULL,
  `RUNNING_TIME_MILLIS` decimal(20,0) DEFAULT NULL,
  `PER_SPLIT_MIN_MILLIS` decimal(20,0) DEFAULT NULL,
  `PER_SPLIT_MAX_MILLIS` decimal(20,0) DEFAULT NULL,
  `PER_SPLIT_MIN_ITEMS` decimal(20,0) DEFAULT NULL,
  `PER_SPLIT_MAX_ITEMS` 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 (`ENTITY_SYNC_ID`,`START_DATE`),
  KEY `ENTSYNC_HSTSNC` (`ENTITY_SYNC_ID`),
  KEY `ENT_SNC_HSR_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `ENT_SNC_HSR_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `ENTSYNC_HSTSNC` FOREIGN KEY (`ENTITY_SYNC_ID`) REFERENCES `ENTITY_SYNC` (`ENTITY_SYNC_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ENTITY_SYNC_INCLUDE`
--

DROP TABLE IF EXISTS `ENTITY_SYNC_INCLUDE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ENTITY_SYNC_INCLUDE` (
  `ENTITY_SYNC_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ENTITY_OR_PACKAGE` varchar(255) COLLATE latin1_general_cs NOT NULL,
  `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 (`ENTITY_SYNC_ID`,`ENTITY_OR_PACKAGE`),
  KEY `ENTSYNC_INCSNC` (`ENTITY_SYNC_ID`),
  KEY `ENT_SNC_INCD_TXSTP` (`LAST_UPDATED_TX_STAMP`),
  KEY `ENT_SNC_INCD_TXCRS` (`CREATED_TX_STAMP`),
  CONSTRAINT `ENTSYNC_INCSNC` FOREIGN KEY (`ENTITY_SYNC_ID`) REFERENCES `ENTITY_SYNC` (`ENTITY_SYNC_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ENTITY_SYNC_INCLUDE_GROUP`
--

DROP TABLE IF EXISTS `ENTITY_SYNC_INCLUDE_GROUP`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ENTITY_SYNC_INCLUDE_GROUP` (
  `ENTITY_SYNC_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ENTITY_GROUP_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 (`ENTITY_SYNC_ID`,`ENTITY_GROUP_ID`),
  KEY `ENTSNCGU_GRP` (`ENTITY_GROUP_ID`),
  KEY `ENTSNCGU_SNC` (`ENTITY_SYNC_ID`),
  KEY `ENT_SNC_IND_GRP_TP` (`LAST_UPDATED_TX_STAMP`),
  KEY `ENT_SNC_IND_GRP_TS` (`CREATED_TX_STAMP`),
  CONSTRAINT `ENTSNCGU_GRP` FOREIGN KEY (`ENTITY_GROUP_ID`) REFERENCES `ENTITY_GROUP` (`ENTITY_GROUP_ID`),
  CONSTRAINT `ENTSNCGU_SNC` FOREIGN KEY (`ENTITY_SYNC_ID`) REFERENCES `ENTITY_SYNC` (`ENTITY_SYNC_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ENTITY_SYNC_REMOVE`
--

DROP TABLE IF EXISTS `ENTITY_SYNC_REMOVE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ENTITY_SYNC_REMOVE` (
  `ENTITY_SYNC_REMOVE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRIMARY_KEY_REMOVED` 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 (`ENTITY_SYNC_REMOVE_ID`),
  KEY `ENT_SNC_RMV_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `ENT_SNC_RMV_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 `ENUMERATION`
--

DROP TABLE IF EXISTS `ENUMERATION`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ENUMERATION` (
  `ENUM_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ENUM_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ENUM_CODE` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `SEQUENCE_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 (`ENUM_ID`),
  KEY `ENUM_TO_TYPE` (`ENUM_TYPE_ID`),
  KEY `ENUMERATION_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `ENUMERATION_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `ENUM_TO_TYPE` FOREIGN KEY (`ENUM_TYPE_ID`) REFERENCES `ENUMERATION_TYPE` (`ENUM_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ENUMERATION_TYPE`
--

DROP TABLE IF EXISTS `ENUMERATION_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ENUMERATION_TYPE` (
  `ENUM_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 (`ENUM_TYPE_ID`),
  KEY `ENUM_TYPE_PARENT` (`PARENT_TYPE_ID`),
  KEY `ENMRTN_TP_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `ENMRTN_TP_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `ENUM_TYPE_PARENT` FOREIGN KEY (`PARENT_TYPE_ID`) REFERENCES `ENUMERATION_TYPE` (`ENUM_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `FACILITY`
--

DROP TABLE IF EXISTS `FACILITY`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `FACILITY` (
  `FACILITY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FACILITY_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PARENT_FACILITY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `OWNER_PARTY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `DEFAULT_INVENTORY_ITEM_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `FACILITY_NAME` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `PRIMARY_FACILITY_GROUP_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SQUARE_FOOTAGE` decimal(20,0) DEFAULT NULL,
  `FACILITY_SIZE` decimal(18,6) DEFAULT NULL,
  `FACILITY_SIZE_UOM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PRODUCT_STORE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `DEFAULT_DAYS_TO_SHIP` decimal(20,0) DEFAULT NULL,
  `OPENED_DATE` datetime DEFAULT NULL,
  `CLOSED_DATE` datetime DEFAULT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `DEFAULT_DIMENSION_UOM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `DEFAULT_WEIGHT_UOM_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 (`FACILITY_ID`),
  KEY `FACILITY_FCTYP` (`FACILITY_TYPE_ID`),
  KEY `FACILITY_PARENT` (`PARENT_FACILITY_ID`),
  KEY `FACILITY_PGRP` (`PRIMARY_FACILITY_GROUP_ID`),
  KEY `FACILITY_OWNER` (`OWNER_PARTY_ID`),
  KEY `FAC_INVITM_TYPE` (`DEFAULT_INVENTORY_ITEM_TYPE_ID`),
  KEY `FAC_DEF_DUOM` (`DEFAULT_DIMENSION_UOM_ID`),
  KEY `FAC_DEF_WUOM` (`DEFAULT_WEIGHT_UOM_ID`),
  KEY `FACILITY_GEOPT` (`GEO_POINT_ID`),
  KEY `FACILITY_SUOM` (`FACILITY_SIZE_UOM_ID`),
  KEY `FACILITY_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
  KEY `FACILITY_TXCRTS` (`CREATED_TX_STAMP`),
  CONSTRAINT `FACILITY_FCTYP` FOREIGN KEY (`FACILITY_TYPE_ID`) REFERENCES `FACILITY_TYPE` (`FACILITY_TYPE_ID`),
  CONSTRAINT `FACILITY_GEOPT` FOREIGN KEY (`GEO_POINT_ID`) REFERENCES `GEO_POINT` (`GEO_POINT_ID`),
  CONSTRAINT `FACILITY_OWNER` FOREIGN KEY (`OWNER_PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `FACILITY_PARENT` FOREIGN KEY (`PARENT_FACILITY_ID`) REFERENCES `FACILITY` (`FACILITY_ID`),
  CONSTRAINT `FACILITY_PGRP` FOREIGN KEY (`PRIMARY_FACILITY_GROUP_ID`) REFERENCES `FACILITY_GROUP` (`FACILITY_GROUP_ID`),
  CONSTRAINT `FACILITY_SUOM` FOREIGN KEY (`FACILITY_SIZE_UOM_ID`) REFERENCES `UOM` (`UOM_ID`),
  CONSTRAINT `FAC_DEF_DUOM` FOREIGN KEY (`DEFAULT_DIMENSION_UOM_ID`) REFERENCES `UOM` (`UOM_ID`),
  CONSTRAINT `FAC_DEF_WUOM` FOREIGN KEY (`DEFAULT_WEIGHT_UOM_ID`) REFERENCES `UOM` (`UOM_ID`),
  CONSTRAINT `FAC_INVITM_TYPE` FOREIGN KEY (`DEFAULT_INVENTORY_ITEM_TYPE_ID`) REFERENCES `INVENTORY_ITEM_TYPE` (`INVENTORY_ITEM_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
