-- Table structure for table `PRODUCT_PROMO_USE`
--

DROP TABLE IF EXISTS `PRODUCT_PROMO_USE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_PROMO_USE` (
  `ORDER_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PROMO_SEQUENCE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_PROMO_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PRODUCT_PROMO_CODE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `TOTAL_DISCOUNT_AMOUNT` decimal(18,2) DEFAULT NULL,
  `QUANTITY_LEFT_IN_ACTIONS` decimal(18,6) DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`ORDER_ID`,`PROMO_SEQUENCE_ID`),
  KEY `PROD_PRUSE_PROMO` (`PRODUCT_PROMO_ID`),
  KEY `PROD_PRUSE_CODE` (`PRODUCT_PROMO_CODE_ID`),
  KEY `PROD_PRUSE_ORDR` (`ORDER_ID`),
  KEY `PROD_PRUSE_PTY` (`PARTY_ID`),
  CONSTRAINT `PROD_PRUSE_CODE` FOREIGN KEY (`PRODUCT_PROMO_CODE_ID`) REFERENCES `PRODUCT_PROMO_CODE` (`PRODUCT_PROMO_CODE_ID`),
  CONSTRAINT `PROD_PRUSE_ORDR` FOREIGN KEY (`ORDER_ID`) REFERENCES `ORDER_HEADER` (`ORDER_ID`),
  CONSTRAINT `PROD_PRUSE_PROMO` FOREIGN KEY (`PRODUCT_PROMO_ID`) REFERENCES `PRODUCT_PROMO` (`PRODUCT_PROMO_ID`),
  CONSTRAINT `PROD_PRUSE_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 `PRODUCT_REVIEW`
--

DROP TABLE IF EXISTS `PRODUCT_REVIEW`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_REVIEW` (
  `PRODUCT_REVIEW_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_STORE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PRODUCT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `USER_LOGIN_ID` varchar(250) COLLATE latin1_general_cs DEFAULT NULL,
  `STATUS_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `POSTED_ANONYMOUS` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `POSTED_DATE_TIME` datetime DEFAULT NULL,
  `PRODUCT_RATING` decimal(18,6) DEFAULT NULL,
  `PRODUCT_REVIEW` 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 (`PRODUCT_REVIEW_ID`),
  KEY `PROD_REVIEW_PRDSTR` (`PRODUCT_STORE_ID`),
  KEY `PROD_REVIEW_PROD` (`PRODUCT_ID`),
  KEY `PROD_REVIEW_ULH` (`USER_LOGIN_ID`),
  KEY `PROD_REVIEW_STTS` (`STATUS_ID`),
  CONSTRAINT `PROD_REVIEW_PRDSTR` FOREIGN KEY (`PRODUCT_STORE_ID`) REFERENCES `PRODUCT_STORE` (`PRODUCT_STORE_ID`),
  CONSTRAINT `PROD_REVIEW_PROD` FOREIGN KEY (`PRODUCT_ID`) REFERENCES `PRODUCT` (`PRODUCT_ID`),
  CONSTRAINT `PROD_REVIEW_STTS` FOREIGN KEY (`STATUS_ID`) REFERENCES `STATUS_ITEM` (`STATUS_ID`),
  CONSTRAINT `PROD_REVIEW_ULH` FOREIGN KEY (`USER_LOGIN_ID`) REFERENCES `USER_LOGIN` (`USER_LOGIN_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PRODUCT_ROLE`
--

DROP TABLE IF EXISTS `PRODUCT_ROLE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_ROLE` (
  `PRODUCT_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,
  `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 (`PRODUCT_ID`,`PARTY_ID`,`ROLE_TYPE_ID`,`FROM_DATE`),
  KEY `PROD_RLE_PTYRLE` (`PARTY_ID`,`ROLE_TYPE_ID`),
  KEY `PROD_RLE_PRODUCT` (`PRODUCT_ID`),
  CONSTRAINT `PROD_RLE_PRODUCT` FOREIGN KEY (`PRODUCT_ID`) REFERENCES `PRODUCT` (`PRODUCT_ID`),
  CONSTRAINT `PROD_RLE_PTYRLE` FOREIGN KEY (`PARTY_ID`, `ROLE_TYPE_ID`) REFERENCES `PARTY_ROLE` (`PARTY_ID`, `ROLE_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PRODUCT_SEARCH_CONSTRAINT`
--

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

--
-- Table structure for table `PRODUCT_SEARCH_RESULT`
--

DROP TABLE IF EXISTS `PRODUCT_SEARCH_RESULT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_SEARCH_RESULT` (
  `PRODUCT_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 (`PRODUCT_SEARCH_RESULT_ID`),
  KEY `PROD_SCHRES_VST` (`VISIT_ID`),
  CONSTRAINT `PROD_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 `PRODUCT_STORE`
--

DROP TABLE IF EXISTS `PRODUCT_STORE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_STORE` (
  `PRODUCT_STORE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRIMARY_STORE_GROUP_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `STORE_NAME` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `COMPANY_NAME` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `TITLE` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `SUBTITLE` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `PAY_TO_PARTY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `DAYS_TO_CANCEL_NON_PAY` decimal(20,0) DEFAULT NULL,
  `MANUAL_AUTH_IS_CAPTURE` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `PRORATE_SHIPPING` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `PRORATE_TAXES` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `VIEW_CART_ON_ADD` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `AUTO_SAVE_CART` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `AUTO_APPROVE_REVIEWS` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `IS_DEMO_STORE` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `IS_IMMEDIATELY_FULFILLED` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `INVENTORY_FACILITY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ONE_INVENTORY_FACILITY` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `CHECK_INVENTORY` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `RESERVE_INVENTORY` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `RESERVE_ORDER_ENUM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `REQUIRE_INVENTORY` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `BALANCE_RES_ON_ORDER_CREATION` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `REQUIREMENT_METHOD_ENUM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ORDER_NUMBER_PREFIX` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `DEFAULT_LOCALE_STRING` varchar(10) COLLATE latin1_general_cs DEFAULT NULL,
  `DEFAULT_CURRENCY_UOM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `DEFAULT_SALES_CHANNEL_ENUM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ALLOW_PASSWORD` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `DEFAULT_PASSWORD` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `EXPLODE_ORDER_ITEMS` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `CHECK_GC_BALANCE` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `RETRY_FAILED_AUTHS` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `HEADER_APPROVED_STATUS` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ITEM_APPROVED_STATUS` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `DIGITAL_ITEM_APPROVED_STATUS` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `HEADER_DECLINED_STATUS` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ITEM_DECLINED_STATUS` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `HEADER_CANCEL_STATUS` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ITEM_CANCEL_STATUS` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `AUTH_DECLINED_MESSAGE` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `AUTH_FRAUD_MESSAGE` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `AUTH_ERROR_MESSAGE` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `VISUAL_THEME_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `STORE_CREDIT_ACCOUNT_ENUM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `USE_PRIMARY_EMAIL_USERNAME` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `REQUIRE_CUSTOMER_ROLE` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `AUTO_INVOICE_DIGITAL_ITEMS` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `REQ_SHIP_ADDR_FOR_DIG_ITEMS` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `SHOW_CHECKOUT_GIFT_OPTIONS` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `SELECT_PAYMENT_TYPE_PER_ITEM` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `SHOW_PRICES_WITH_VAT_TAX` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `SHOW_TAX_IS_EXEMPT` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `VAT_TAX_AUTH_GEO_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `VAT_TAX_AUTH_PARTY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ENABLE_AUTO_SUGGESTION_LIST` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `ENABLE_DIG_PROD_UPLOAD` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `PROD_SEARCH_EXCLUDE_VARIANTS` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `DIG_PROD_UPLOAD_CATEGORY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `AUTO_ORDER_CC_TRY_EXP` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `AUTO_ORDER_CC_TRY_OTHER_CARDS` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `AUTO_ORDER_CC_TRY_LATER_NSF` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `AUTO_ORDER_CC_TRY_LATER_MAX` decimal(20,0) DEFAULT NULL,
  `STORE_CREDIT_VALID_DAYS` decimal(20,0) DEFAULT NULL,
  `AUTO_APPROVE_INVOICE` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `AUTO_APPROVE_ORDER` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `SHIP_IF_CAPTURE_FAILS` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `SET_OWNER_UPON_ISSUANCE` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `REQ_RETURN_INVENTORY_RECEIVE` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `ADD_TO_CART_REMOVE_INCOMPAT` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `ADD_TO_CART_REPLACE_UPSELL` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `SPLIT_PAY_PREF_PER_SHP_GRP` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `MANAGED_BY_LOT` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `SHOW_OUT_OF_STOCK_PRODUCTS` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `ORDER_DECIMAL_QUANTITY` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `STYLE_SHEET` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `HEADER_LOGO` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `HEADER_MIDDLE_BACKGROUND` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `HEADER_RIGHT_BACKGROUND` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`PRODUCT_STORE_ID`),
  KEY `PROD_STR_PRSTRGP` (`PRIMARY_STORE_GROUP_ID`),
  KEY `PROD_STR_FACILITY` (`INVENTORY_FACILITY_ID`),
  KEY `PROD_STR_RORDENUM` (`RESERVE_ORDER_ENUM_ID`),
  KEY `PROD_STR_RQMTENUM` (`REQUIREMENT_METHOD_ENUM_ID`),
  KEY `PROD_STR_PAYTOPTY` (`PAY_TO_PARTY_ID`),
  KEY `PROD_STR_CURUOM` (`DEFAULT_CURRENCY_UOM_ID`),
  KEY `PROD_STR_SALECHN` (`DEFAULT_SALES_CHANNEL_ENUM_ID`),
  KEY `PROD_STR_HAPSTS` (`HEADER_APPROVED_STATUS`),
  KEY `PROD_STR_IAPSTS` (`ITEM_APPROVED_STATUS`),
  KEY `PROD_STR_DIAPSTS` (`DIGITAL_ITEM_APPROVED_STATUS`),
  KEY `PROD_STR_HDCSTS` (`HEADER_DECLINED_STATUS`),
  KEY `PROD_STR_IDCSTS` (`ITEM_DECLINED_STATUS`),
  KEY `PROD_STR_HCNSTS` (`HEADER_CANCEL_STATUS`),
  KEY `PROD_STR_ICNSTS` (`ITEM_CANCEL_STATUS`),
  KEY `PROD_STR_VATTXA` (`VAT_TAX_AUTH_GEO_ID`,`VAT_TAX_AUTH_PARTY_ID`),
  KEY `PROD_STR_STRCRDACT` (`STORE_CREDIT_ACCOUNT_ENUM_ID`),
  CONSTRAINT `PROD_STR_CURUOM` FOREIGN KEY (`DEFAULT_CURRENCY_UOM_ID`) REFERENCES `UOM` (`UOM_ID`),
  CONSTRAINT `PROD_STR_DIAPSTS` FOREIGN KEY (`DIGITAL_ITEM_APPROVED_STATUS`) REFERENCES `STATUS_ITEM` (`STATUS_ID`),
  CONSTRAINT `PROD_STR_FACILITY` FOREIGN KEY (`INVENTORY_FACILITY_ID`) REFERENCES `FACILITY` (`FACILITY_ID`),
  CONSTRAINT `PROD_STR_HAPSTS` FOREIGN KEY (`HEADER_APPROVED_STATUS`) REFERENCES `STATUS_ITEM` (`STATUS_ID`),
  CONSTRAINT `PROD_STR_HCNSTS` FOREIGN KEY (`HEADER_CANCEL_STATUS`) REFERENCES `STATUS_ITEM` (`STATUS_ID`),
  CONSTRAINT `PROD_STR_HDCSTS` FOREIGN KEY (`HEADER_DECLINED_STATUS`) REFERENCES `STATUS_ITEM` (`STATUS_ID`),
  CONSTRAINT `PROD_STR_IAPSTS` FOREIGN KEY (`ITEM_APPROVED_STATUS`) REFERENCES `STATUS_ITEM` (`STATUS_ID`),
  CONSTRAINT `PROD_STR_ICNSTS` FOREIGN KEY (`ITEM_CANCEL_STATUS`) REFERENCES `STATUS_ITEM` (`STATUS_ID`),
  CONSTRAINT `PROD_STR_IDCSTS` FOREIGN KEY (`ITEM_DECLINED_STATUS`) REFERENCES `STATUS_ITEM` (`STATUS_ID`),
  CONSTRAINT `PROD_STR_PAYTOPTY` FOREIGN KEY (`PAY_TO_PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `PROD_STR_PRSTRGP` FOREIGN KEY (`PRIMARY_STORE_GROUP_ID`) REFERENCES `PRODUCT_STORE_GROUP` (`PRODUCT_STORE_GROUP_ID`),
  CONSTRAINT `PROD_STR_RORDENUM` FOREIGN KEY (`RESERVE_ORDER_ENUM_ID`) REFERENCES `ENUMERATION` (`ENUM_ID`),
  CONSTRAINT `PROD_STR_RQMTENUM` FOREIGN KEY (`REQUIREMENT_METHOD_ENUM_ID`) REFERENCES `ENUMERATION` (`ENUM_ID`),
  CONSTRAINT `PROD_STR_SALECHN` FOREIGN KEY (`DEFAULT_SALES_CHANNEL_ENUM_ID`) REFERENCES `ENUMERATION` (`ENUM_ID`),
  CONSTRAINT `PROD_STR_STRCRDACT` FOREIGN KEY (`STORE_CREDIT_ACCOUNT_ENUM_ID`) REFERENCES `ENUMERATION` (`ENUM_ID`),
  CONSTRAINT `PROD_STR_VATTXA` FOREIGN KEY (`VAT_TAX_AUTH_GEO_ID`, `VAT_TAX_AUTH_PARTY_ID`) REFERENCES `TAX_AUTHORITY` (`TAX_AUTH_GEO_ID`, `TAX_AUTH_PARTY_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PRODUCT_STORE_CATALOG`
--

DROP TABLE IF EXISTS `PRODUCT_STORE_CATALOG`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_STORE_CATALOG` (
  `PRODUCT_STORE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PROD_CATALOG_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FROM_DATE` datetime NOT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `SEQUENCE_NUM` decimal(20,0) DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`PRODUCT_STORE_ID`,`PROD_CATALOG_ID`,`FROM_DATE`),
  KEY `PS_CAT_PRDSTR` (`PRODUCT_STORE_ID`),
  KEY `PS_CAT_CATALOG` (`PROD_CATALOG_ID`),
  CONSTRAINT `PS_CAT_CATALOG` FOREIGN KEY (`PROD_CATALOG_ID`) REFERENCES `PROD_CATALOG` (`PROD_CATALOG_ID`),
  CONSTRAINT `PS_CAT_PRDSTR` FOREIGN KEY (`PRODUCT_STORE_ID`) REFERENCES `PRODUCT_STORE` (`PRODUCT_STORE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PRODUCT_STORE_EMAIL_SETTING`
--

DROP TABLE IF EXISTS `PRODUCT_STORE_EMAIL_SETTING`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_STORE_EMAIL_SETTING` (
  `PRODUCT_STORE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `EMAIL_TYPE` varchar(20) COLLATE latin1_general_cs NOT 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 (`PRODUCT_STORE_ID`,`EMAIL_TYPE`),
  KEY `PRDSTREM_PRDS` (`PRODUCT_STORE_ID`),
  KEY `PRDSTREM_ENUM` (`EMAIL_TYPE`),
  CONSTRAINT `PRDSTREM_ENUM` FOREIGN KEY (`EMAIL_TYPE`) REFERENCES `ENUMERATION` (`ENUM_ID`),
  CONSTRAINT `PRDSTREM_PRDS` FOREIGN KEY (`PRODUCT_STORE_ID`) REFERENCES `PRODUCT_STORE` (`PRODUCT_STORE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PRODUCT_STORE_FACILITY`
--

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

--
-- Table structure for table `PRODUCT_STORE_FIN_ACT_SETTING`
--

DROP TABLE IF EXISTS `PRODUCT_STORE_FIN_ACT_SETTING`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_STORE_FIN_ACT_SETTING` (
  `PRODUCT_STORE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FIN_ACCOUNT_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `REQUIRE_PIN_CODE` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `VALIDATE_G_C_FIN_ACCT` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `ACCOUNT_CODE_LENGTH` decimal(20,0) DEFAULT NULL,
  `PIN_CODE_LENGTH` decimal(20,0) DEFAULT NULL,
  `ACCOUNT_VALID_DAYS` decimal(20,0) DEFAULT NULL,
  `AUTH_VALID_DAYS` decimal(20,0) DEFAULT NULL,
  `PURCHASE_SURVEY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PURCH_SURVEY_SEND_TO` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PURCH_SURVEY_COPY_ME` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ALLOW_AUTH_TO_NEGATIVE` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `MIN_BALANCE` decimal(18,2) DEFAULT NULL,
  `REPLENISH_THRESHOLD` decimal(18,2) DEFAULT NULL,
  `REPLENISH_METHOD_ENUM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`PRODUCT_STORE_ID`,`FIN_ACCOUNT_TYPE_ID`),
  KEY `PRSTFNAC_PRDS` (`PRODUCT_STORE_ID`),
  KEY `PRSTFNAC_FNACTP` (`FIN_ACCOUNT_TYPE_ID`),
  KEY `PRSTFNAC_SRVY` (`PURCHASE_SURVEY_ID`),
  KEY `PRSTFNAC_FARPMTD` (`REPLENISH_METHOD_ENUM_ID`),
  CONSTRAINT `PRSTFNAC_FARPMTD` FOREIGN KEY (`REPLENISH_METHOD_ENUM_ID`) REFERENCES `ENUMERATION` (`ENUM_ID`),
  CONSTRAINT `PRSTFNAC_FNACTP` FOREIGN KEY (`FIN_ACCOUNT_TYPE_ID`) REFERENCES `FIN_ACCOUNT_TYPE` (`FIN_ACCOUNT_TYPE_ID`),
  CONSTRAINT `PRSTFNAC_PRDS` FOREIGN KEY (`PRODUCT_STORE_ID`) REFERENCES `PRODUCT_STORE` (`PRODUCT_STORE_ID`),
  CONSTRAINT `PRSTFNAC_SRVY` FOREIGN KEY (`PURCHASE_SURVEY_ID`) REFERENCES `SURVEY` (`SURVEY_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PRODUCT_STORE_GROUP`
--

DROP TABLE IF EXISTS `PRODUCT_STORE_GROUP`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_STORE_GROUP` (
  `PRODUCT_STORE_GROUP_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_STORE_GROUP_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PRIMARY_PARENT_GROUP_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PRODUCT_STORE_GROUP_NAME` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`PRODUCT_STORE_GROUP_ID`),
  KEY `PRDSTR_GP_TYPE` (`PRODUCT_STORE_GROUP_TYPE_ID`),
  KEY `PRDSTR_GP_PGRP` (`PRIMARY_PARENT_GROUP_ID`),
  CONSTRAINT `PRDSTR_GP_PGRP` FOREIGN KEY (`PRIMARY_PARENT_GROUP_ID`) REFERENCES `PRODUCT_STORE_GROUP` (`PRODUCT_STORE_GROUP_ID`),
  CONSTRAINT `PRDSTR_GP_TYPE` FOREIGN KEY (`PRODUCT_STORE_GROUP_TYPE_ID`) REFERENCES `PRODUCT_STORE_GROUP_TYPE` (`PRODUCT_STORE_GROUP_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PRODUCT_STORE_GROUP_MEMBER`
--

DROP TABLE IF EXISTS `PRODUCT_STORE_GROUP_MEMBER`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_STORE_GROUP_MEMBER` (
  `PRODUCT_STORE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_STORE_GROUP_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FROM_DATE` datetime NOT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `SEQUENCE_NUM` decimal(20,0) DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`PRODUCT_STORE_ID`,`PRODUCT_STORE_GROUP_ID`,`FROM_DATE`),
  KEY `PRDSTR_MEM_PRDSTR` (`PRODUCT_STORE_ID`),
  KEY `PRDSTR_MEM_PSGRP` (`PRODUCT_STORE_GROUP_ID`),
  CONSTRAINT `PRDSTR_MEM_PRDSTR` FOREIGN KEY (`PRODUCT_STORE_ID`) REFERENCES `PRODUCT_STORE` (`PRODUCT_STORE_ID`),
  CONSTRAINT `PRDSTR_MEM_PSGRP` FOREIGN KEY (`PRODUCT_STORE_GROUP_ID`) REFERENCES `PRODUCT_STORE_GROUP` (`PRODUCT_STORE_GROUP_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PRODUCT_STORE_GROUP_ROLE`
--

DROP TABLE IF EXISTS `PRODUCT_STORE_GROUP_ROLE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_STORE_GROUP_ROLE` (
  `PRODUCT_STORE_GROUP_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ROLE_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`PRODUCT_STORE_GROUP_ID`,`PARTY_ID`,`ROLE_TYPE_ID`),
  KEY `PSGRP_RLE_PSGP` (`PRODUCT_STORE_GROUP_ID`),
  KEY `PSGRP_RLE_PTRLE` (`PARTY_ID`,`ROLE_TYPE_ID`),
  CONSTRAINT `PSGRP_RLE_PSGP` FOREIGN KEY (`PRODUCT_STORE_GROUP_ID`) REFERENCES `PRODUCT_STORE_GROUP` (`PRODUCT_STORE_GROUP_ID`),
  CONSTRAINT `PSGRP_RLE_PTRLE` FOREIGN KEY (`PARTY_ID`, `ROLE_TYPE_ID`) REFERENCES `PARTY_ROLE` (`PARTY_ID`, `ROLE_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PRODUCT_STORE_GROUP_ROLLUP`
--

DROP TABLE IF EXISTS `PRODUCT_STORE_GROUP_ROLLUP`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_STORE_GROUP_ROLLUP` (
  `PRODUCT_STORE_GROUP_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARENT_GROUP_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FROM_DATE` datetime NOT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `SEQUENCE_NUM` decimal(20,0) DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`PRODUCT_STORE_GROUP_ID`,`PARENT_GROUP_ID`,`FROM_DATE`),
  KEY `PSGRP_RLP_CURRENT` (`PRODUCT_STORE_GROUP_ID`),
  KEY `PSGRP_RLP_PARENT` (`PARENT_GROUP_ID`),
  CONSTRAINT `PSGRP_RLP_CURRENT` FOREIGN KEY (`PRODUCT_STORE_GROUP_ID`) REFERENCES `PRODUCT_STORE_GROUP` (`PRODUCT_STORE_GROUP_ID`),
  CONSTRAINT `PSGRP_RLP_PARENT` FOREIGN KEY (`PARENT_GROUP_ID`) REFERENCES `PRODUCT_STORE_GROUP` (`PRODUCT_STORE_GROUP_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PRODUCT_STORE_GROUP_TYPE`
--

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

--
-- Table structure for table `PRODUCT_STORE_KEYWORD_OVRD`
--

DROP TABLE IF EXISTS `PRODUCT_STORE_KEYWORD_OVRD`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_STORE_KEYWORD_OVRD` (
  `PRODUCT_STORE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `KEYWORD` varchar(60) COLLATE latin1_general_cs NOT NULL,
  `FROM_DATE` datetime NOT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `TARGET` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `TARGET_TYPE_ENUM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`PRODUCT_STORE_ID`,`KEYWORD`,`FROM_DATE`),
  KEY `PRDSTRKWO_PRDS` (`PRODUCT_STORE_ID`),
  KEY `PRDSTRKWO_ENM` (`TARGET_TYPE_ENUM_ID`),
  CONSTRAINT `PRDSTRKWO_ENM` FOREIGN KEY (`TARGET_TYPE_ENUM_ID`) REFERENCES `ENUMERATION` (`ENUM_ID`),
  CONSTRAINT `PRDSTRKWO_PRDS` FOREIGN KEY (`PRODUCT_STORE_ID`) REFERENCES `PRODUCT_STORE` (`PRODUCT_STORE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PRODUCT_STORE_PAYMENT_SETTING`
--

DROP TABLE IF EXISTS `PRODUCT_STORE_PAYMENT_SETTING`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_STORE_PAYMENT_SETTING` (
  `PRODUCT_STORE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PAYMENT_METHOD_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PAYMENT_SERVICE_TYPE_ENUM_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PAYMENT_SERVICE` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `PAYMENT_CUSTOM_METHOD_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PAYMENT_GATEWAY_CONFIG_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PAYMENT_PROPERTIES_PATH` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `APPLY_TO_ALL_PRODUCTS` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`PRODUCT_STORE_ID`,`PAYMENT_METHOD_TYPE_ID`,`PAYMENT_SERVICE_TYPE_ENUM_ID`),
  KEY `PRDS_PS_PRDS` (`PRODUCT_STORE_ID`),
  KEY `PRDS_PS_PMNTTP` (`PAYMENT_METHOD_TYPE_ID`),
  KEY `PRDS_PS_ENUM` (`PAYMENT_SERVICE_TYPE_ENUM_ID`),
  KEY `PRDS_PS_PGC` (`PAYMENT_GATEWAY_CONFIG_ID`),
  KEY `PRDS_PS_CUS_MET` (`PAYMENT_CUSTOM_METHOD_ID`),
  CONSTRAINT `PRDS_PS_CUS_MET` FOREIGN KEY (`PAYMENT_CUSTOM_METHOD_ID`) REFERENCES `CUSTOM_METHOD` (`CUSTOM_METHOD_ID`),
  CONSTRAINT `PRDS_PS_ENUM` FOREIGN KEY (`PAYMENT_SERVICE_TYPE_ENUM_ID`) REFERENCES `ENUMERATION` (`ENUM_ID`),
  CONSTRAINT `PRDS_PS_PGC` FOREIGN KEY (`PAYMENT_GATEWAY_CONFIG_ID`) REFERENCES `PAYMENT_GATEWAY_CONFIG` (`PAYMENT_GATEWAY_CONFIG_ID`),
  CONSTRAINT `PRDS_PS_PMNTTP` FOREIGN KEY (`PAYMENT_METHOD_TYPE_ID`) REFERENCES `PAYMENT_METHOD_TYPE` (`PAYMENT_METHOD_TYPE_ID`),
  CONSTRAINT `PRDS_PS_PRDS` FOREIGN KEY (`PRODUCT_STORE_ID`) REFERENCES `PRODUCT_STORE` (`PRODUCT_STORE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PRODUCT_STORE_PROMO_APPL`
--

DROP TABLE IF EXISTS `PRODUCT_STORE_PROMO_APPL`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_STORE_PROMO_APPL` (
  `PRODUCT_STORE_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,
  `MANUAL_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 (`PRODUCT_STORE_ID`,`PRODUCT_PROMO_ID`,`FROM_DATE`),
  KEY `PRDSTRPRMO_PRDS` (`PRODUCT_STORE_ID`),
  KEY `PRDSTRPRMO_PRMO` (`PRODUCT_PROMO_ID`),
  CONSTRAINT `PRDSTRPRMO_PRDS` FOREIGN KEY (`PRODUCT_STORE_ID`) REFERENCES `PRODUCT_STORE` (`PRODUCT_STORE_ID`),
  CONSTRAINT `PRDSTRPRMO_PRMO` FOREIGN KEY (`PRODUCT_PROMO_ID`) REFERENCES `PRODUCT_PROMO` (`PRODUCT_PROMO_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PRODUCT_STORE_ROLE`
--

DROP TABLE IF EXISTS `PRODUCT_STORE_ROLE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_STORE_ROLE` (
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ROLE_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_STORE_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 (`PARTY_ID`,`ROLE_TYPE_ID`,`PRODUCT_STORE_ID`,`FROM_DATE`),
  KEY `PRDSTRRLE_PRLE` (`PARTY_ID`,`ROLE_TYPE_ID`),
  KEY `PRDSTRRLE_PRDS` (`PRODUCT_STORE_ID`),
  CONSTRAINT `PRDSTRRLE_PRDS` FOREIGN KEY (`PRODUCT_STORE_ID`) REFERENCES `PRODUCT_STORE` (`PRODUCT_STORE_ID`),
  CONSTRAINT `PRDSTRRLE_PRLE` FOREIGN KEY (`PARTY_ID`, `ROLE_TYPE_ID`) REFERENCES `PARTY_ROLE` (`PARTY_ID`, `ROLE_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PRODUCT_STORE_SHIPMENT_METH`
--

DROP TABLE IF EXISTS `PRODUCT_STORE_SHIPMENT_METH`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_STORE_SHIPMENT_METH` (
  `PRODUCT_STORE_SHIP_METH_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_STORE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SHIPMENT_METHOD_TYPE_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,
  `COMPANY_PARTY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `MIN_WEIGHT` decimal(18,6) DEFAULT NULL,
  `MAX_WEIGHT` decimal(18,6) DEFAULT NULL,
  `MIN_SIZE` decimal(18,6) DEFAULT NULL,
  `MAX_SIZE` decimal(18,6) DEFAULT NULL,
  `MIN_TOTAL` decimal(18,2) DEFAULT NULL,
  `MAX_TOTAL` decimal(18,2) DEFAULT NULL,
  `ALLOW_USPS_ADDR` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `REQUIRE_USPS_ADDR` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `ALLOW_COMPANY_ADDR` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `REQUIRE_COMPANY_ADDR` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `INCLUDE_NO_CHARGE_ITEMS` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `INCLUDE_FEATURE_GROUP` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `EXCLUDE_FEATURE_GROUP` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `INCLUDE_GEO_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `EXCLUDE_GEO_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SERVICE_NAME` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `CONFIG_PROPS` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `SHIPMENT_CUSTOM_METHOD_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SHIPMENT_GATEWAY_CONFIG_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SEQUENCE_NUMBER` decimal(20,0) DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`PRODUCT_STORE_SHIP_METH_ID`),
  KEY `SHIPMENTMETHODTYPE` (`SHIPMENT_METHOD_TYPE_ID`),
  KEY `PRDS_SM_SGC` (`SHIPMENT_GATEWAY_CONFIG_ID`),
  KEY `PRDS_SM_CUS_MET` (`SHIPMENT_CUSTOM_METHOD_ID`),
  CONSTRAINT `PRDS_SM_CUS_MET` FOREIGN KEY (`SHIPMENT_CUSTOM_METHOD_ID`) REFERENCES `CUSTOM_METHOD` (`CUSTOM_METHOD_ID`),
  CONSTRAINT `PRDS_SM_SGC` FOREIGN KEY (`SHIPMENT_GATEWAY_CONFIG_ID`) REFERENCES `SHIPMENT_GATEWAY_CONFIG` (`SHIPMENT_GATEWAY_CONFIG_ID`),
  CONSTRAINT `SHIPMENTMETHODTYPE` 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 `PRODUCT_STORE_SURVEY_APPL`
--

DROP TABLE IF EXISTS `PRODUCT_STORE_SURVEY_APPL`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_STORE_SURVEY_APPL` (
  `PRODUCT_STORE_SURVEY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_STORE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SURVEY_APPL_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `GROUP_NAME` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `SURVEY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PRODUCT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PRODUCT_CATEGORY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `FROM_DATE` datetime DEFAULT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `SURVEY_TEMPLATE` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `RESULT_TEMPLATE` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `SEQUENCE_NUM` decimal(20,0) DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`PRODUCT_STORE_SURVEY_ID`),
  KEY `PRDSTRSVY_PRDS` (`PRODUCT_STORE_ID`),
  KEY `PRDSTRSVY_SRVY` (`SURVEY_ID`),
  KEY `PRDSTRSVY_SATP` (`SURVEY_APPL_TYPE_ID`),
  CONSTRAINT `PRDSTRSVY_PRDS` FOREIGN KEY (`PRODUCT_STORE_ID`) REFERENCES `PRODUCT_STORE` (`PRODUCT_STORE_ID`),
  CONSTRAINT `PRDSTRSVY_SATP` FOREIGN KEY (`SURVEY_APPL_TYPE_ID`) REFERENCES `SURVEY_APPL_TYPE` (`SURVEY_APPL_TYPE_ID`),
  CONSTRAINT `PRDSTRSVY_SRVY` FOREIGN KEY (`SURVEY_ID`) REFERENCES `SURVEY` (`SURVEY_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PRODUCT_STORE_VENDOR_PAYMENT`
--

DROP TABLE IF EXISTS `PRODUCT_STORE_VENDOR_PAYMENT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_STORE_VENDOR_PAYMENT` (
  `PRODUCT_STORE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `VENDOR_PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PAYMENT_METHOD_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CREDIT_CARD_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 (`PRODUCT_STORE_ID`,`VENDOR_PARTY_ID`,`PAYMENT_METHOD_TYPE_ID`,`CREDIT_CARD_ENUM_ID`),
  KEY `PRDSTRVPM_PRDS` (`PRODUCT_STORE_ID`),
  KEY `PRDSTRVPM_VPTY` (`VENDOR_PARTY_ID`),
  KEY `PRDSTRVPM_PMMT` (`PAYMENT_METHOD_TYPE_ID`),
  KEY `PRDSTRVPM_CCEN` (`CREDIT_CARD_ENUM_ID`),
  CONSTRAINT `PRDSTRVPM_CCEN` FOREIGN KEY (`CREDIT_CARD_ENUM_ID`) REFERENCES `ENUMERATION` (`ENUM_ID`),
  CONSTRAINT `PRDSTRVPM_PMMT` FOREIGN KEY (`PAYMENT_METHOD_TYPE_ID`) REFERENCES `PAYMENT_METHOD_TYPE` (`PAYMENT_METHOD_TYPE_ID`),
  CONSTRAINT `PRDSTRVPM_PRDS` FOREIGN KEY (`PRODUCT_STORE_ID`) REFERENCES `PRODUCT_STORE` (`PRODUCT_STORE_ID`),
  CONSTRAINT `PRDSTRVPM_VPTY` FOREIGN KEY (`VENDOR_PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PRODUCT_STORE_VENDOR_SHIPMENT`
--

DROP TABLE IF EXISTS `PRODUCT_STORE_VENDOR_SHIPMENT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_STORE_VENDOR_SHIPMENT` (
  `PRODUCT_STORE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `VENDOR_PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `SHIPMENT_METHOD_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CARRIER_PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`PRODUCT_STORE_ID`,`VENDOR_PARTY_ID`,`SHIPMENT_METHOD_TYPE_ID`,`CARRIER_PARTY_ID`),
  KEY `PRDSTRVSH_PRDS` (`PRODUCT_STORE_ID`),
  KEY `PRDSTRVSH_VPTY` (`VENDOR_PARTY_ID`),
  KEY `PRDSTRVSH_SHMT` (`SHIPMENT_METHOD_TYPE_ID`),
  KEY `PRDSTRVSH_CPTY` (`CARRIER_PARTY_ID`),
  CONSTRAINT `PRDSTRVSH_CPTY` FOREIGN KEY (`CARRIER_PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `PRDSTRVSH_PRDS` FOREIGN KEY (`PRODUCT_STORE_ID`) REFERENCES `PRODUCT_STORE` (`PRODUCT_STORE_ID`),
  CONSTRAINT `PRDSTRVSH_SHMT` FOREIGN KEY (`SHIPMENT_METHOD_TYPE_ID`) REFERENCES `SHIPMENT_METHOD_TYPE` (`SHIPMENT_METHOD_TYPE_ID`),
  CONSTRAINT `PRDSTRVSH_VPTY` FOREIGN KEY (`VENDOR_PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PRODUCT_SUBSCRIPTION_RESOURCE`
--

DROP TABLE IF EXISTS `PRODUCT_SUBSCRIPTION_RESOURCE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PRODUCT_SUBSCRIPTION_RESOURCE` (
  `PRODUCT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `SUBSCRIPTION_RESOURCE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FROM_DATE` datetime NOT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `PURCHASE_FROM_DATE` datetime DEFAULT NULL,
  `PURCHASE_THRU_DATE` datetime DEFAULT NULL,
  `MAX_LIFE_TIME` decimal(20,0) DEFAULT NULL,
  `MAX_LIFE_TIME_UOM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `AVAILABLE_TIME` decimal(20,0) DEFAULT NULL,
  `AVAILABLE_TIME_UOM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `USE_COUNT_LIMIT` decimal(20,0) DEFAULT NULL,
  `USE_TIME` decimal(20,0) DEFAULT NULL,
  `USE_TIME_UOM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `USE_ROLE_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `AUTOMATIC_EXTEND` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `CANCL_AUTM_EXT_TIME` decimal(20,0) DEFAULT NULL,
  `CANCL_AUTM_EXT_TIME_UOM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`PRODUCT_ID`,`SUBSCRIPTION_RESOURCE_ID`,`FROM_DATE`),
  KEY `PROD_SBRS_PROD` (`PRODUCT_ID`),
  KEY `PROD_SBRS_SBRS` (`SUBSCRIPTION_RESOURCE_ID`),
  KEY `PROD_SBRS_URT` (`USE_ROLE_TYPE_ID`),
  KEY `PROD_SBRS_UTU` (`USE_TIME_UOM_ID`),
  KEY `PROD_SBRS_CTU` (`CANCL_AUTM_EXT_TIME_UOM_ID`),
  KEY `PROD_SBRS_ATU` (`AVAILABLE_TIME_UOM_ID`),
  KEY `PROD_SBRS_MTU` (`MAX_LIFE_TIME_UOM_ID`),
  CONSTRAINT `PROD_SBRS_ATU` FOREIGN KEY (`AVAILABLE_TIME_UOM_ID`) REFERENCES `UOM` (`UOM_ID`),
  CONSTRAINT `PROD_SBRS_CTU` FOREIGN KEY (`CANCL_AUTM_EXT_TIME_UOM_ID`) REFERENCES `UOM` (`UOM_ID`),
  CONSTRAINT `PROD_SBRS_MTU` FOREIGN KEY (`MAX_LIFE_TIME_UOM_ID`) REFERENCES `UOM` (`UOM_ID`),
  CONSTRAINT `PROD_SBRS_PROD` FOREIGN KEY (`PRODUCT_ID`) REFERENCES `PRODUCT` (`PRODUCT_ID`),
  CONSTRAINT `PROD_SBRS_SBRS` FOREIGN KEY (`SUBSCRIPTION_RESOURCE_ID`) REFERENCES `SUBSCRIPTION_RESOURCE` (`SUBSCRIPTION_RESOURCE_ID`),
  CONSTRAINT `PROD_SBRS_URT` FOREIGN KEY (`USE_ROLE_TYPE_ID`) REFERENCES `ROLE_TYPE` (`ROLE_TYPE_ID`),
  CONSTRAINT `PROD_SBRS_UTU` FOREIGN KEY (`USE_TIME_UOM_ID`) REFERENCES `UOM` (`UOM_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PRODUCT_TYPE`
--

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

--
-- Table structure for table `PRODUCT_TYPE_ATTR`
--

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

--
-- Table structure for table `PROD_CATALOG`
--

DROP TABLE IF EXISTS `PROD_CATALOG`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PROD_CATALOG` (
  `PROD_CATALOG_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CATALOG_NAME` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `USE_QUICK_ADD` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `STYLE_SHEET` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `HEADER_LOGO` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `CONTENT_PATH_PREFIX` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `TEMPLATE_PATH_PREFIX` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `VIEW_ALLOW_PERM_REQD` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `PURCHASE_ALLOW_PERM_REQD` 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 (`PROD_CATALOG_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PROD_CATALOG_CATEGORY`
--

DROP TABLE IF EXISTS `PROD_CATALOG_CATEGORY`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PROD_CATALOG_CATEGORY` (
  `PROD_CATALOG_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_CATEGORY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PROD_CATALOG_CATEGORY_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FROM_DATE` datetime NOT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `SEQUENCE_NUM` decimal(20,0) DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`PROD_CATALOG_ID`,`PRODUCT_CATEGORY_ID`,`PROD_CATALOG_CATEGORY_TYPE_ID`,`FROM_DATE`),
  KEY `PROD_CC_CATALOG` (`PROD_CATALOG_ID`),
  KEY `PROD_CC_CATEGORY` (`PRODUCT_CATEGORY_ID`),
  KEY `PROD_CC_TYPE` (`PROD_CATALOG_CATEGORY_TYPE_ID`),
  CONSTRAINT `PROD_CC_CATALOG` FOREIGN KEY (`PROD_CATALOG_ID`) REFERENCES `PROD_CATALOG` (`PROD_CATALOG_ID`),
  CONSTRAINT `PROD_CC_CATEGORY` FOREIGN KEY (`PRODUCT_CATEGORY_ID`) REFERENCES `PRODUCT_CATEGORY` (`PRODUCT_CATEGORY_ID`),
  CONSTRAINT `PROD_CC_TYPE` FOREIGN KEY (`PROD_CATALOG_CATEGORY_TYPE_ID`) REFERENCES `PROD_CATALOG_CATEGORY_TYPE` (`PROD_CATALOG_CATEGORY_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PROD_CATALOG_CATEGORY_TYPE`
--

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

--
-- Table structure for table `PROD_CATALOG_INV_FACILITY`
--

DROP TABLE IF EXISTS `PROD_CATALOG_INV_FACILITY`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PROD_CATALOG_INV_FACILITY` (
  `PROD_CATALOG_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FACILITY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FROM_DATE` datetime NOT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `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 (`PROD_CATALOG_ID`,`FACILITY_ID`,`FROM_DATE`),
  KEY `PROD_CIF_CATALOG` (`PROD_CATALOG_ID`),
  KEY `PROD_CIF_FACILITY` (`FACILITY_ID`),
  CONSTRAINT `PROD_CIF_CATALOG` FOREIGN KEY (`PROD_CATALOG_ID`) REFERENCES `PROD_CATALOG` (`PROD_CATALOG_ID`),
  CONSTRAINT `PROD_CIF_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 `PROD_CATALOG_ROLE`
--

DROP TABLE IF EXISTS `PROD_CATALOG_ROLE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PROD_CATALOG_ROLE` (
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ROLE_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PROD_CATALOG_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 (`PARTY_ID`,`ROLE_TYPE_ID`,`PROD_CATALOG_ID`,`FROM_DATE`),
  KEY `PCATRLE_PTYRLE` (`PARTY_ID`,`ROLE_TYPE_ID`),
  KEY `PCATRLE_CATALOG` (`PROD_CATALOG_ID`),
  CONSTRAINT `PCATRLE_CATALOG` FOREIGN KEY (`PROD_CATALOG_ID`) REFERENCES `PROD_CATALOG` (`PROD_CATALOG_ID`),
  CONSTRAINT `PCATRLE_PTYRLE` FOREIGN KEY (`PARTY_ID`, `ROLE_TYPE_ID`) REFERENCES `PARTY_ROLE` (`PARTY_ID`, `ROLE_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PROD_CONF_ITEM_CONTENT`
--

DROP TABLE IF EXISTS `PROD_CONF_ITEM_CONTENT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PROD_CONF_ITEM_CONTENT` (
  `CONFIG_ITEM_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CONTENT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CONF_ITEM_CONTENT_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FROM_DATE` datetime NOT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`CONFIG_ITEM_ID`,`CONTENT_ID`,`CONF_ITEM_CONTENT_TYPE_ID`,`FROM_DATE`),
  KEY `CIMT_CNT_PCIT` (`CONFIG_ITEM_ID`),
  KEY `CIMT_CNT_CNT` (`CONTENT_ID`),
  KEY `CIMT_CNT_TYPE` (`CONF_ITEM_CONTENT_TYPE_ID`),
  CONSTRAINT `CIMT_CNT_CNT` FOREIGN KEY (`CONTENT_ID`) REFERENCES `CONTENT` (`CONTENT_ID`),
  CONSTRAINT `CIMT_CNT_PCIT` FOREIGN KEY (`CONFIG_ITEM_ID`) REFERENCES `PRODUCT_CONFIG_ITEM` (`CONFIG_ITEM_ID`),
  CONSTRAINT `CIMT_CNT_TYPE` FOREIGN KEY (`CONF_ITEM_CONTENT_TYPE_ID`) REFERENCES `PROD_CONF_ITEM_CONTENT_TYPE` (`CONF_ITEM_CONTENT_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PROD_CONF_ITEM_CONTENT_TYPE`
--

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

--
-- Table structure for table `PROTECTED_VIEW`
--

DROP TABLE IF EXISTS `PROTECTED_VIEW`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `PROTECTED_VIEW` (
  `GROUP_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `VIEW_NAME_ID` varchar(60) COLLATE latin1_general_cs NOT NULL,
  `MAX_HITS` decimal(20,0) DEFAULT NULL,
  `MAX_HITS_DURATION` decimal(20,0) DEFAULT NULL,
  `TARPIT_DURATION` 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 (`GROUP_ID`,`VIEW_NAME_ID`),
  KEY `VIEW_SECGRP_GRP` (`GROUP_ID`),
  CONSTRAINT `VIEW_SECGRP_GRP` FOREIGN KEY (`GROUP_ID`) REFERENCES `SECURITY_GROUP` (`GROUP_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `PROTOCOL_TYPE`
--

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

--
-- Table structure for table `QUANTITY_BREAK`
--

DROP TABLE IF EXISTS `QUANTITY_BREAK`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `QUANTITY_BREAK` (
  `QUANTITY_BREAK_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `QUANTITY_BREAK_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `FROM_QUANTITY` decimal(18,6) DEFAULT NULL,
  `THRU_QUANTITY` decimal(18,6) DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`QUANTITY_BREAK_ID`),
  KEY `QUANT_BRK_TYPE` (`QUANTITY_BREAK_TYPE_ID`),
  CONSTRAINT `QUANT_BRK_TYPE` FOREIGN KEY (`QUANTITY_BREAK_TYPE_ID`) REFERENCES `QUANTITY_BREAK_TYPE` (`QUANTITY_BREAK_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `QUANTITY_BREAK_TYPE`
--

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

--
-- Table structure for table `QUOTE`
--

DROP TABLE IF EXISTS `QUOTE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `QUOTE` (
  `QUOTE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `QUOTE_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ISSUE_DATE` datetime DEFAULT NULL,
  `STATUS_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `CURRENCY_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,
  `VALID_FROM_DATE` datetime DEFAULT NULL,
  `VALID_THRU_DATE` datetime DEFAULT NULL,
  `QUOTE_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 (`QUOTE_ID`),
  KEY `QUOTE_QTTYP` (`QUOTE_TYPE_ID`),
  KEY `QUOTE_PRTY` (`PARTY_ID`),
  KEY `QUOTE_STATUS` (`STATUS_ID`),
  KEY `QUOTE_CUOM` (`CURRENCY_UOM_ID`),
  KEY `QUOTE_PRDS` (`PRODUCT_STORE_ID`),
  KEY `QUOTE_CHANNEL` (`SALES_CHANNEL_ENUM_ID`),
  CONSTRAINT `QUOTE_CHANNEL` FOREIGN KEY (`SALES_CHANNEL_ENUM_ID`) REFERENCES `ENUMERATION` (`ENUM_ID`),
  CONSTRAINT `QUOTE_CUOM` FOREIGN KEY (`CURRENCY_UOM_ID`) REFERENCES `UOM` (`UOM_ID`),
  CONSTRAINT `QUOTE_PRDS` FOREIGN KEY (`PRODUCT_STORE_ID`) REFERENCES `PRODUCT_STORE` (`PRODUCT_STORE_ID`),
  CONSTRAINT `QUOTE_PRTY` FOREIGN KEY (`PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `QUOTE_QTTYP` FOREIGN KEY (`QUOTE_TYPE_ID`) REFERENCES `QUOTE_TYPE` (`QUOTE_TYPE_ID`),
  CONSTRAINT `QUOTE_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 `QUOTE_ADJUSTMENT`
--

DROP TABLE IF EXISTS `QUOTE_ADJUSTMENT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `QUOTE_ADJUSTMENT` (
  `QUOTE_ADJUSTMENT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `QUOTE_ADJUSTMENT_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `QUOTE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `QUOTE_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `COMMENTS` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `AMOUNT` decimal(18,2) DEFAULT NULL,
  `PRODUCT_PROMO_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PRODUCT_PROMO_RULE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PRODUCT_PROMO_ACTION_SEQ_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PRODUCT_FEATURE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `CORRESPONDING_PRODUCT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SOURCE_REFERENCE_ID` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `SOURCE_PERCENTAGE` decimal(18,6) DEFAULT NULL,
  `CUSTOMER_REFERENCE_ID` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `PRIMARY_GEO_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SECONDARY_GEO_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `EXEMPT_AMOUNT` decimal(18,2) DEFAULT NULL,
  `TAX_AUTH_GEO_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `TAX_AUTH_PARTY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `OVERRIDE_GL_ACCOUNT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `INCLUDE_IN_TAX` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `INCLUDE_IN_SHIPPING` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `CREATED_DATE` datetime DEFAULT NULL,
  `CREATED_BY_USER_LOGIN` varchar(250) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_MODIFIED_DATE` datetime DEFAULT NULL,
  `LAST_MODIFIED_BY_USER_LOGIN` varchar(250) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`QUOTE_ADJUSTMENT_ID`),
  KEY `QUOTE_ADJ_TYPE` (`QUOTE_ADJUSTMENT_TYPE_ID`),
  KEY `QUOTE_ADJ_OHEAD` (`QUOTE_ID`),
  KEY `QUOTE_ADJ_USERL` (`CREATED_BY_USER_LOGIN`),
  KEY `QUOTE_ADJ_PROMO` (`PRODUCT_PROMO_ID`),
  KEY `QUOTE_ADJ_PRGEO` (`PRIMARY_GEO_ID`),
  KEY `QUOTE_ADJ_SCGEO` (`SECONDARY_GEO_ID`),
  KEY `QUOTE_ADJ_TXA` (`TAX_AUTH_GEO_ID`,`TAX_AUTH_PARTY_ID`),
  KEY `QUOTE_ADJ_OGLA` (`OVERRIDE_GL_ACCOUNT_ID`),
  CONSTRAINT `QUOTE_ADJ_OGLA` FOREIGN KEY (`OVERRIDE_GL_ACCOUNT_ID`) REFERENCES `GL_ACCOUNT` (`GL_ACCOUNT_ID`),
  CONSTRAINT `QUOTE_ADJ_OHEAD` FOREIGN KEY (`QUOTE_ID`) REFERENCES `QUOTE` (`QUOTE_ID`),
  CONSTRAINT `QUOTE_ADJ_PRGEO` FOREIGN KEY (`PRIMARY_GEO_ID`) REFERENCES `GEO` (`GEO_ID`),
  CONSTRAINT `QUOTE_ADJ_PROMO` FOREIGN KEY (`PRODUCT_PROMO_ID`) REFERENCES `PRODUCT_PROMO` (`PRODUCT_PROMO_ID`),
  CONSTRAINT `QUOTE_ADJ_SCGEO` FOREIGN KEY (`SECONDARY_GEO_ID`) REFERENCES `GEO` (`GEO_ID`),
  CONSTRAINT `QUOTE_ADJ_TXA` FOREIGN KEY (`TAX_AUTH_GEO_ID`, `TAX_AUTH_PARTY_ID`) REFERENCES `TAX_AUTHORITY` (`TAX_AUTH_GEO_ID`, `TAX_AUTH_PARTY_ID`),
  CONSTRAINT `QUOTE_ADJ_TYPE` FOREIGN KEY (`QUOTE_ADJUSTMENT_TYPE_ID`) REFERENCES `ORDER_ADJUSTMENT_TYPE` (`ORDER_ADJUSTMENT_TYPE_ID`),
  CONSTRAINT `QUOTE_ADJ_USERL` FOREIGN KEY (`CREATED_BY_USER_LOGIN`) REFERENCES `USER_LOGIN` (`USER_LOGIN_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `QUOTE_ATTRIBUTE`
--

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

--
-- Table structure for table `QUOTE_COEFFICIENT`
--

DROP TABLE IF EXISTS `QUOTE_COEFFICIENT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `QUOTE_COEFFICIENT` (
  `QUOTE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `COEFF_NAME` varchar(60) COLLATE latin1_general_cs NOT NULL,
  `COEFF_VALUE` decimal(18,6) DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`QUOTE_ID`,`COEFF_NAME`),
  KEY `QUOTE_COEFF` (`QUOTE_ID`),
  CONSTRAINT `QUOTE_COEFF` FOREIGN KEY (`QUOTE_ID`) REFERENCES `QUOTE` (`QUOTE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `QUOTE_ITEM`
--

DROP TABLE IF EXISTS `QUOTE_ITEM`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `QUOTE_ITEM` (
  `QUOTE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `QUOTE_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PRODUCT_FEATURE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `DELIVERABLE_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SKILL_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `UOM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `WORK_EFFORT_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,
  `QUANTITY` decimal(18,6) DEFAULT NULL,
  `SELECTED_AMOUNT` decimal(18,6) DEFAULT NULL,
  `QUOTE_UNIT_PRICE` 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,
  `ESTIMATED_DELIVERY_DATE` datetime DEFAULT NULL,
  `COMMENTS` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `IS_PROMO` 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 (`QUOTE_ID`,`QUOTE_ITEM_SEQ_ID`),
  KEY `QUOTE_ITM_QTE` (`QUOTE_ID`),
  KEY `QUOTE_ITM_PROD` (`PRODUCT_ID`),
  KEY `QUOTE_ITM_PFEAT` (`PRODUCT_FEATURE_ID`),
  KEY `QUOTE_ITM_DELT` (`DELIVERABLE_TYPE_ID`),
  KEY `QUOTE_ITM_SKLT` (`SKILL_TYPE_ID`),
  KEY `QUOTE_ITM_UOM` (`UOM_ID`),
  KEY `QUOTE_ITM_WKEFF` (`WORK_EFFORT_ID`),
  KEY `QUOTE_ITM_CSRQ` (`CUST_REQUEST_ID`),
  KEY `QUOTE_ITM_CSRITM` (`CUST_REQUEST_ID`,`CUST_REQUEST_ITEM_SEQ_ID`),
  CONSTRAINT `QUOTE_ITM_CSRITM` FOREIGN KEY (`CUST_REQUEST_ID`, `CUST_REQUEST_ITEM_SEQ_ID`) REFERENCES `CUST_REQUEST_ITEM` (`CUST_REQUEST_ID`, `CUST_REQUEST_ITEM_SEQ_ID`),
  CONSTRAINT `QUOTE_ITM_CSRQ` FOREIGN KEY (`CUST_REQUEST_ID`) REFERENCES `CUST_REQUEST` (`CUST_REQUEST_ID`),
  CONSTRAINT `QUOTE_ITM_DELT` FOREIGN KEY (`DELIVERABLE_TYPE_ID`) REFERENCES `DELIVERABLE_TYPE` (`DELIVERABLE_TYPE_ID`),
  CONSTRAINT `QUOTE_ITM_PFEAT` FOREIGN KEY (`PRODUCT_FEATURE_ID`) REFERENCES `PRODUCT_FEATURE` (`PRODUCT_FEATURE_ID`),
  CONSTRAINT `QUOTE_ITM_PROD` FOREIGN KEY (`PRODUCT_ID`) REFERENCES `PRODUCT` (`PRODUCT_ID`),
  CONSTRAINT `QUOTE_ITM_QTE` FOREIGN KEY (`QUOTE_ID`) REFERENCES `QUOTE` (`QUOTE_ID`),
  CONSTRAINT `QUOTE_ITM_SKLT` FOREIGN KEY (`SKILL_TYPE_ID`) REFERENCES `SKILL_TYPE` (`SKILL_TYPE_ID`),
  CONSTRAINT `QUOTE_ITM_UOM` FOREIGN KEY (`UOM_ID`) REFERENCES `UOM` (`UOM_ID`),
  CONSTRAINT `QUOTE_ITM_WKEFF` 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 `QUOTE_NOTE`
--

DROP TABLE IF EXISTS `QUOTE_NOTE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `QUOTE_NOTE` (
  `QUOTE_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 (`QUOTE_ID`,`NOTE_ID`),
  KEY `QUOTE_NT_QTE` (`QUOTE_ID`),
  KEY `QUOTE_NT_NOTE` (`NOTE_ID`),
  CONSTRAINT `QUOTE_NT_NOTE` FOREIGN KEY (`NOTE_ID`) REFERENCES `NOTE_DATA` (`NOTE_ID`),
  CONSTRAINT `QUOTE_NT_QTE` FOREIGN KEY (`QUOTE_ID`) REFERENCES `QUOTE` (`QUOTE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `QUOTE_ROLE`
--

DROP TABLE IF EXISTS `QUOTE_ROLE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `QUOTE_ROLE` (
  `QUOTE_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 (`QUOTE_ID`,`PARTY_ID`,`ROLE_TYPE_ID`),
  KEY `QUOTE_RL_QUOTE` (`QUOTE_ID`),
  KEY `QUOTE_RL_PARTY` (`PARTY_ID`),
  KEY `QUOTE_RL_PROLE` (`PARTY_ID`,`ROLE_TYPE_ID`),
  CONSTRAINT `QUOTE_RL_PARTY` FOREIGN KEY (`PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `QUOTE_RL_PROLE` FOREIGN KEY (`PARTY_ID`, `ROLE_TYPE_ID`) REFERENCES `PARTY_ROLE` (`PARTY_ID`, `ROLE_TYPE_ID`),
  CONSTRAINT `QUOTE_RL_QUOTE` FOREIGN KEY (`QUOTE_ID`) REFERENCES `QUOTE` (`QUOTE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `QUOTE_TERM`
--

DROP TABLE IF EXISTS `QUOTE_TERM`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `QUOTE_TERM` (
  `TERM_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `QUOTE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `QUOTE_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `TERM_VALUE` decimal(20,0) DEFAULT NULL,
  `UOM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `TERM_DAYS` decimal(20,0) DEFAULT NULL,
  `TEXT_VALUE` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`TERM_TYPE_ID`,`QUOTE_ID`,`QUOTE_ITEM_SEQ_ID`),
  KEY `QUOTE_TERM_QTE` (`QUOTE_ID`),
  KEY `QUOTE_TERM_TTYPE` (`TERM_TYPE_ID`),
  CONSTRAINT `QUOTE_TERM_QTE` FOREIGN KEY (`QUOTE_ID`) REFERENCES `QUOTE` (`QUOTE_ID`),
  CONSTRAINT `QUOTE_TERM_TTYPE` 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 `QUOTE_TERM_ATTRIBUTE`
--

DROP TABLE IF EXISTS `QUOTE_TERM_ATTRIBUTE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `QUOTE_TERM_ATTRIBUTE` (
  `TERM_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `QUOTE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `QUOTE_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ATTR_NAME` varchar(60) COLLATE latin1_general_cs NOT NULL,
  `ATTR_VALUE` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`TERM_TYPE_ID`,`QUOTE_ID`,`QUOTE_ITEM_SEQ_ID`,`ATTR_NAME`),
  KEY `QUOTE_TERM_ATTR` (`TERM_TYPE_ID`,`QUOTE_ID`,`QUOTE_ITEM_SEQ_ID`),
  CONSTRAINT `QUOTE_TERM_ATTR` FOREIGN KEY (`TERM_TYPE_ID`, `QUOTE_ID`, `QUOTE_ITEM_SEQ_ID`) REFERENCES `QUOTE_TERM` (`TERM_TYPE_ID`, `QUOTE_ID`, `QUOTE_ITEM_SEQ_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `QUOTE_TYPE`
--

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

--
-- Table structure for table `QUOTE_TYPE_ATTR`
--

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

--
-- Table structure for table `QUOTE_WORK_EFFORT`
--

DROP TABLE IF EXISTS `QUOTE_WORK_EFFORT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `QUOTE_WORK_EFFORT` (
  `QUOTE_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 (`QUOTE_ID`,`WORK_EFFORT_ID`),
  KEY `QUOTE_WE_QUOTE` (`QUOTE_ID`),
  KEY `QUOTE_WE_WEFF` (`WORK_EFFORT_ID`),
  CONSTRAINT `QUOTE_WE_QUOTE` FOREIGN KEY (`QUOTE_ID`) REFERENCES `QUOTE` (`QUOTE_ID`),
  CONSTRAINT `QUOTE_WE_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 `RATE_AMOUNT`
--

DROP TABLE IF EXISTS `RATE_AMOUNT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `RATE_AMOUNT` (
  `RATE_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `RATE_CURRENCY_UOM_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PERIOD_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `WORK_EFFORT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `EMPL_POSITION_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FROM_DATE` datetime NOT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `RATE_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 (`RATE_TYPE_ID`,`RATE_CURRENCY_UOM_ID`,`PERIOD_TYPE_ID`,`PARTY_ID`,`WORK_EFFORT_ID`,`EMPL_POSITION_TYPE_ID`,`FROM_DATE`),
  KEY `RATE_AMOUNT_RT` (`RATE_TYPE_ID`),
  KEY `RATE_AMOUNT_RCT` (`RATE_CURRENCY_UOM_ID`),
  KEY `RATE_AMOUNT_WE` (`WORK_EFFORT_ID`),
  KEY `RATE_AMOUNT_PTY` (`PARTY_ID`),
  KEY `RATE_AMOUNT_EPT` (`EMPL_POSITION_TYPE_ID`),
  KEY `RATE_AMOUNT_PT` (`PERIOD_TYPE_ID`),
  CONSTRAINT `RATE_AMOUNT_EPT` FOREIGN KEY (`EMPL_POSITION_TYPE_ID`) REFERENCES `EMPL_POSITION_TYPE` (`EMPL_POSITION_TYPE_ID`),
  CONSTRAINT `RATE_AMOUNT_PT` FOREIGN KEY (`PERIOD_TYPE_ID`) REFERENCES `PERIOD_TYPE` (`PERIOD_TYPE_ID`),
  CONSTRAINT `RATE_AMOUNT_PTY` FOREIGN KEY (`PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `RATE_AMOUNT_RCT` FOREIGN KEY (`RATE_CURRENCY_UOM_ID`) REFERENCES `UOM` (`UOM_ID`),
  CONSTRAINT `RATE_AMOUNT_RT` FOREIGN KEY (`RATE_TYPE_ID`) REFERENCES `RATE_TYPE` (`RATE_TYPE_ID`),
  CONSTRAINT `RATE_AMOUNT_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 `RATE_TYPE`
--

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

--
-- Table structure for table `RECURRENCE_INFO`
--

DROP TABLE IF EXISTS `RECURRENCE_INFO`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `RECURRENCE_INFO` (
  `RECURRENCE_INFO_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `START_DATE_TIME` datetime DEFAULT NULL,
  `EXCEPTION_DATE_TIMES` longtext COLLATE latin1_general_cs,
  `RECURRENCE_DATE_TIMES` longtext COLLATE latin1_general_cs,
  `EXCEPTION_RULE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `RECURRENCE_RULE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `RECURRENCE_COUNT` decimal(20,0) DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`RECURRENCE_INFO_ID`),
  KEY `REC_INFO_RCRLE` (`RECURRENCE_RULE_ID`),
  KEY `REC_INFO_EX_RCRLE` (`EXCEPTION_RULE_ID`),
  CONSTRAINT `REC_INFO_EX_RCRLE` FOREIGN KEY (`EXCEPTION_RULE_ID`) REFERENCES `RECURRENCE_RULE` (`RECURRENCE_RULE_ID`),
  CONSTRAINT `REC_INFO_RCRLE` FOREIGN KEY (`RECURRENCE_RULE_ID`) REFERENCES `RECURRENCE_RULE` (`RECURRENCE_RULE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `RECURRENCE_RULE`
--

DROP TABLE IF EXISTS `RECURRENCE_RULE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `RECURRENCE_RULE` (
  `RECURRENCE_RULE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FREQUENCY` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `UNTIL_DATE_TIME` datetime DEFAULT NULL,
  `COUNT_NUMBER` decimal(20,0) DEFAULT NULL,
  `INTERVAL_NUMBER` decimal(20,0) DEFAULT NULL,
  `BY_SECOND_LIST` longtext COLLATE latin1_general_cs,
  `BY_MINUTE_LIST` longtext COLLATE latin1_general_cs,
  `BY_HOUR_LIST` longtext COLLATE latin1_general_cs,
  `BY_DAY_LIST` longtext COLLATE latin1_general_cs,
  `BY_MONTH_DAY_LIST` longtext COLLATE latin1_general_cs,
  `BY_YEAR_DAY_LIST` longtext COLLATE latin1_general_cs,
  `BY_WEEK_NO_LIST` longtext COLLATE latin1_general_cs,
  `BY_MONTH_LIST` longtext COLLATE latin1_general_cs,
  `BY_SET_POS_LIST` longtext COLLATE latin1_general_cs,
  `WEEK_START` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `X_NAME` 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 (`RECURRENCE_RULE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `REJECTION_REASON`
--

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

--
-- Table structure for table `REORDER_GUIDELINE`
--

DROP TABLE IF EXISTS `REORDER_GUIDELINE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `REORDER_GUIDELINE` (
  `REORDER_GUIDELINE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_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,
  `FACILITY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `GEO_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `FROM_DATE` datetime DEFAULT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `REORDER_QUANTITY` decimal(18,6) DEFAULT NULL,
  `REORDER_LEVEL` 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 (`REORDER_GUIDELINE_ID`),
  KEY `REORDER_GD_PROD` (`PRODUCT_ID`),
  KEY `REORDER_GD_PARTY` (`PARTY_ID`),
  KEY `REORDER_GD_FAC` (`FACILITY_ID`),
  KEY `REORDER_GD_GEO` (`GEO_ID`),
  CONSTRAINT `REORDER_GD_FAC` FOREIGN KEY (`FACILITY_ID`) REFERENCES `FACILITY` (`FACILITY_ID`),
  CONSTRAINT `REORDER_GD_GEO` FOREIGN KEY (`GEO_ID`) REFERENCES `GEO` (`GEO_ID`),
  CONSTRAINT `REORDER_GD_PARTY` FOREIGN KEY (`PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `REORDER_GD_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 `REQUIREMENT`
--

DROP TABLE IF EXISTS `REQUIREMENT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `REQUIREMENT` (
  `REQUIREMENT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `REQUIREMENT_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `FACILITY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `DELIVERABLE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `FIXED_ASSET_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PRODUCT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `STATUS_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `REQUIREMENT_START_DATE` datetime DEFAULT NULL,
  `REQUIRED_BY_DATE` datetime DEFAULT NULL,
  `ESTIMATED_BUDGET` decimal(18,2) DEFAULT NULL,
  `QUANTITY` decimal(18,6) DEFAULT NULL,
  `USE_CASE` longtext COLLATE latin1_general_cs,
  `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 (`REQUIREMENT_ID`),
  KEY `REQ_TYPE` (`REQUIREMENT_TYPE_ID`),
  KEY `REQ_FACILITY` (`FACILITY_ID`),
  KEY `REQ_DELIVERABLE` (`DELIVERABLE_ID`),
  KEY `REQ_FIXED_ASSET` (`FIXED_ASSET_ID`),
  KEY `REQ_PRODUCT` (`PRODUCT_ID`),
  KEY `REQ_STTS` (`STATUS_ID`),
  CONSTRAINT `REQ_DELIVERABLE` FOREIGN KEY (`DELIVERABLE_ID`) REFERENCES `DELIVERABLE` (`DELIVERABLE_ID`),
  CONSTRAINT `REQ_FACILITY` FOREIGN KEY (`FACILITY_ID`) REFERENCES `FACILITY` (`FACILITY_ID`),
  CONSTRAINT `REQ_FIXED_ASSET` FOREIGN KEY (`FIXED_ASSET_ID`) REFERENCES `FIXED_ASSET` (`FIXED_ASSET_ID`),
  CONSTRAINT `REQ_PRODUCT` FOREIGN KEY (`PRODUCT_ID`) REFERENCES `PRODUCT` (`PRODUCT_ID`),
  CONSTRAINT `REQ_STTS` FOREIGN KEY (`STATUS_ID`) REFERENCES `STATUS_ITEM` (`STATUS_ID`),
  CONSTRAINT `REQ_TYPE` FOREIGN KEY (`REQUIREMENT_TYPE_ID`) REFERENCES `REQUIREMENT_TYPE` (`REQUIREMENT_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `REQUIREMENT_ATTRIBUTE`
--

DROP TABLE IF EXISTS `REQUIREMENT_ATTRIBUTE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `REQUIREMENT_ATTRIBUTE` (
  `REQUIREMENT_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 (`REQUIREMENT_ID`,`ATTR_NAME`),
  KEY `REQ_ATTR` (`REQUIREMENT_ID`),
  CONSTRAINT `REQ_ATTR` 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 `REQUIREMENT_BUDGET_ALLOCATION`
--

DROP TABLE IF EXISTS `REQUIREMENT_BUDGET_ALLOCATION`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `REQUIREMENT_BUDGET_ALLOCATION` (
  `BUDGET_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `BUDGET_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `REQUIREMENT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `AMOUNT` decimal(18,2) DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`BUDGET_ID`,`BUDGET_ITEM_SEQ_ID`,`REQUIREMENT_ID`),
  KEY `REQ_BDGTAL_BITM` (`BUDGET_ID`,`BUDGET_ITEM_SEQ_ID`),
  KEY `REQ_BDGTAL_REQ` (`REQUIREMENT_ID`),
  CONSTRAINT `REQ_BDGTAL_BITM` FOREIGN KEY (`BUDGET_ID`, `BUDGET_ITEM_SEQ_ID`) REFERENCES `BUDGET_ITEM` (`BUDGET_ID`, `BUDGET_ITEM_SEQ_ID`),
  CONSTRAINT `REQ_BDGTAL_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 `REQUIREMENT_CUST_REQUEST`
--

DROP TABLE IF EXISTS `REQUIREMENT_CUST_REQUEST`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `REQUIREMENT_CUST_REQUEST` (
  `CUST_REQUEST_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CUST_REQUEST_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `REQUIREMENT_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`,`REQUIREMENT_ID`),
  KEY `REQ_CSREQ_CRITM` (`CUST_REQUEST_ID`,`CUST_REQUEST_ITEM_SEQ_ID`),
  KEY `REQ_CSREQ_REQ` (`REQUIREMENT_ID`),
  CONSTRAINT `REQ_CSREQ_CRITM` FOREIGN KEY (`CUST_REQUEST_ID`, `CUST_REQUEST_ITEM_SEQ_ID`) REFERENCES `CUST_REQUEST_ITEM` (`CUST_REQUEST_ID`, `CUST_REQUEST_ITEM_SEQ_ID`),
  CONSTRAINT `REQ_CSREQ_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 `REQUIREMENT_ROLE`
--

DROP TABLE IF EXISTS `REQUIREMENT_ROLE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `REQUIREMENT_ROLE` (
  `REQUIREMENT_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 (`REQUIREMENT_ID`,`PARTY_ID`,`ROLE_TYPE_ID`,`FROM_DATE`),
  KEY `REQ_ROLE_REQ` (`REQUIREMENT_ID`),
  KEY `REQ_ROLE_PRTY` (`PARTY_ID`),
  KEY `REQ_ROLE_PROLE` (`PARTY_ID`,`ROLE_TYPE_ID`),
  CONSTRAINT `REQ_ROLE_PROLE` FOREIGN KEY (`PARTY_ID`, `ROLE_TYPE_ID`) REFERENCES `PARTY_ROLE` (`PARTY_ID`, `ROLE_TYPE_ID`),
  CONSTRAINT `REQ_ROLE_PRTY` FOREIGN KEY (`PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `REQ_ROLE_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 `REQUIREMENT_STATUS`
--

DROP TABLE IF EXISTS `REQUIREMENT_STATUS`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `REQUIREMENT_STATUS` (
  `REQUIREMENT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `STATUS_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `STATUS_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 (`REQUIREMENT_ID`,`STATUS_ID`),
  KEY `REQ_STTS_REQ` (`REQUIREMENT_ID`),
  KEY `REQ_STTS_STTS` (`STATUS_ID`),
  CONSTRAINT `REQ_STTS_REQ` FOREIGN KEY (`REQUIREMENT_ID`) REFERENCES `REQUIREMENT` (`REQUIREMENT_ID`),
  CONSTRAINT `REQ_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 `REQUIREMENT_TYPE`
--

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

--
-- Table structure for table `REQUIREMENT_TYPE_ATTR`
--

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

--
-- Table structure for table `RESPONDING_PARTY`
--

DROP TABLE IF EXISTS `RESPONDING_PARTY`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `RESPONDING_PARTY` (
  `RESPONDING_PARTY_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CUST_REQUEST_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CONTACT_MECH_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `DATE_SENT` 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 (`RESPONDING_PARTY_SEQ_ID`,`CUST_REQUEST_ID`,`PARTY_ID`),
  KEY `RESP_PTY_CSREQ` (`CUST_REQUEST_ID`),
  KEY `RESP_PTY_PARTY` (`PARTY_ID`),
  KEY `RESP_PTY_CMECH` (`CONTACT_MECH_ID`),
  CONSTRAINT `RESP_PTY_CMECH` FOREIGN KEY (`CONTACT_MECH_ID`) REFERENCES `CONTACT_MECH` (`CONTACT_MECH_ID`),
  CONSTRAINT `RESP_PTY_CSREQ` FOREIGN KEY (`CUST_REQUEST_ID`) REFERENCES `CUST_REQUEST` (`CUST_REQUEST_ID`),
  CONSTRAINT `RESP_PTY_PARTY` FOREIGN KEY (`PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `RESPONSIBILITY_TYPE`
--

DROP TABLE IF EXISTS `RESPONSIBILITY_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `RESPONSIBILITY_TYPE` (
  `RESPONSIBILITY_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 (`RESPONSIBILITY_TYPE_ID`),
  KEY `RESPON_TYPE_PAR` (`PARENT_TYPE_ID`),
  CONSTRAINT `RESPON_TYPE_PAR` FOREIGN KEY (`PARENT_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 `RETURN_ADJUSTMENT`
--

DROP TABLE IF EXISTS `RETURN_ADJUSTMENT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `RETURN_ADJUSTMENT` (
  `RETURN_ADJUSTMENT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `RETURN_ADJUSTMENT_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `RETURN_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `RETURN_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SHIP_GROUP_SEQ_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `COMMENTS` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `RETURN_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ORDER_ADJUSTMENT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `AMOUNT` decimal(18,3) DEFAULT NULL,
  `PRODUCT_PROMO_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PRODUCT_PROMO_RULE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PRODUCT_PROMO_ACTION_SEQ_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PRODUCT_FEATURE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `CORRESPONDING_PRODUCT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `TAX_AUTHORITY_RATE_SEQ_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SOURCE_REFERENCE_ID` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `SOURCE_PERCENTAGE` decimal(18,6) DEFAULT NULL,
  `CUSTOMER_REFERENCE_ID` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `PRIMARY_GEO_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SECONDARY_GEO_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `EXEMPT_AMOUNT` decimal(18,2) DEFAULT NULL,
  `TAX_AUTH_GEO_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `TAX_AUTH_PARTY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `OVERRIDE_GL_ACCOUNT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `INCLUDE_IN_TAX` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `INCLUDE_IN_SHIPPING` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `CREATED_DATE` datetime DEFAULT NULL,
  `CREATED_BY_USER_LOGIN` varchar(250) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_MODIFIED_DATE` datetime DEFAULT NULL,
  `LAST_MODIFIED_BY_USER_LOGIN` varchar(250) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`RETURN_ADJUSTMENT_ID`),
  KEY `RETURN_ADJ_TYPE` (`RETURN_ADJUSTMENT_TYPE_ID`),
  KEY `RETURN_ADJ_RHEAD` (`RETURN_ID`),
  KEY `RETURN_ADJ_USERL` (`CREATED_BY_USER_LOGIN`),
  KEY `RETURN_ADJ_PROMO` (`PRODUCT_PROMO_ID`),
  KEY `RETURN_ADJ_PRGEO` (`PRIMARY_GEO_ID`),
  KEY `RETURN_ADJ_SCGEO` (`SECONDARY_GEO_ID`),
  KEY `RETURN_ADJ_TXA` (`TAX_AUTH_GEO_ID`,`TAX_AUTH_PARTY_ID`),
  KEY `RETURN_ADJ_OGLA` (`OVERRIDE_GL_ACCOUNT_ID`),
  KEY `RET_ADJ_RTN_TYPE` (`RETURN_TYPE_ID`),
  KEY `RETURN_ADJ_ORDADJ` (`ORDER_ADJUSTMENT_ID`),
  KEY `RETURN_ADJ_TARP` (`TAX_AUTHORITY_RATE_SEQ_ID`),
  CONSTRAINT `RETURN_ADJ_OGLA` FOREIGN KEY (`OVERRIDE_GL_ACCOUNT_ID`) REFERENCES `GL_ACCOUNT` (`GL_ACCOUNT_ID`),
  CONSTRAINT `RETURN_ADJ_ORDADJ` FOREIGN KEY (`ORDER_ADJUSTMENT_ID`) REFERENCES `ORDER_ADJUSTMENT` (`ORDER_ADJUSTMENT_ID`),
  CONSTRAINT `RETURN_ADJ_PRGEO` FOREIGN KEY (`PRIMARY_GEO_ID`) REFERENCES `GEO` (`GEO_ID`),
  CONSTRAINT `RETURN_ADJ_PROMO` FOREIGN KEY (`PRODUCT_PROMO_ID`) REFERENCES `PRODUCT_PROMO` (`PRODUCT_PROMO_ID`),
  CONSTRAINT `RETURN_ADJ_RHEAD` FOREIGN KEY (`RETURN_ID`) REFERENCES `RETURN_HEADER` (`RETURN_ID`),
  CONSTRAINT `RETURN_ADJ_SCGEO` FOREIGN KEY (`SECONDARY_GEO_ID`) REFERENCES `GEO` (`GEO_ID`),
  CONSTRAINT `RETURN_ADJ_TARP` FOREIGN KEY (`TAX_AUTHORITY_RATE_SEQ_ID`) REFERENCES `TAX_AUTHORITY_RATE_PRODUCT` (`TAX_AUTHORITY_RATE_SEQ_ID`),
  CONSTRAINT `RETURN_ADJ_TXA` FOREIGN KEY (`TAX_AUTH_GEO_ID`, `TAX_AUTH_PARTY_ID`) REFERENCES `TAX_AUTHORITY` (`TAX_AUTH_GEO_ID`, `TAX_AUTH_PARTY_ID`),
  CONSTRAINT `RETURN_ADJ_TYPE` FOREIGN KEY (`RETURN_ADJUSTMENT_TYPE_ID`) REFERENCES `RETURN_ADJUSTMENT_TYPE` (`RETURN_ADJUSTMENT_TYPE_ID`),
  CONSTRAINT `RETURN_ADJ_USERL` FOREIGN KEY (`CREATED_BY_USER_LOGIN`) REFERENCES `USER_LOGIN` (`USER_LOGIN_ID`),
  CONSTRAINT `RET_ADJ_RTN_TYPE` FOREIGN KEY (`RETURN_TYPE_ID`) REFERENCES `RETURN_TYPE` (`RETURN_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `RETURN_ADJUSTMENT_TYPE`
--

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

--
-- Table structure for table `RETURN_CONTACT_MECH`
--

DROP TABLE IF EXISTS `RETURN_CONTACT_MECH`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `RETURN_CONTACT_MECH` (
  `RETURN_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CONTACT_MECH_PURPOSE_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CONTACT_MECH_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`RETURN_ID`,`CONTACT_MECH_PURPOSE_TYPE_ID`,`CONTACT_MECH_ID`),
  KEY `RETURN_CMECH_HDR` (`RETURN_ID`),
  KEY `RETURN_CMECH_CM` (`CONTACT_MECH_ID`),
  KEY `RETURN_CMECH_CMPT` (`CONTACT_MECH_PURPOSE_TYPE_ID`),
  CONSTRAINT `RETURN_CMECH_CM` FOREIGN KEY (`CONTACT_MECH_ID`) REFERENCES `CONTACT_MECH` (`CONTACT_MECH_ID`),
  CONSTRAINT `RETURN_CMECH_CMPT` FOREIGN KEY (`CONTACT_MECH_PURPOSE_TYPE_ID`) REFERENCES `CONTACT_MECH_PURPOSE_TYPE` (`CONTACT_MECH_PURPOSE_TYPE_ID`),
  CONSTRAINT `RETURN_CMECH_HDR` FOREIGN KEY (`RETURN_ID`) REFERENCES `RETURN_HEADER` (`RETURN_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `RETURN_HEADER`
--

DROP TABLE IF EXISTS `RETURN_HEADER`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `RETURN_HEADER` (
  `RETURN_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `RETURN_HEADER_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `STATUS_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `CREATED_BY` varchar(250) COLLATE latin1_general_cs DEFAULT NULL,
  `FROM_PARTY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `TO_PARTY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PAYMENT_METHOD_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `FIN_ACCOUNT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `BILLING_ACCOUNT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ENTRY_DATE` datetime DEFAULT NULL,
  `ORIGIN_CONTACT_MECH_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `DESTINATION_FACILITY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `NEEDS_INVENTORY_RECEIVE` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `CURRENCY_UOM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SUPPLIER_RMA_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 (`RETURN_ID`),
  KEY `RTN_HEAD_TYPE` (`RETURN_HEADER_TYPE_ID`),
  KEY `RTN_FROM_PARTY` (`FROM_PARTY_ID`),
  KEY `RTN_TO_PARTY` (`TO_PARTY_ID`),
  KEY `RTN_TO_BACT` (`BILLING_ACCOUNT_ID`),
  KEY `RTN_TO_FACT` (`FIN_ACCOUNT_ID`),
  KEY `RTN_TO_PAYMETH` (`PAYMENT_METHOD_ID`),
  KEY `RTN_TO_FACILITY` (`DESTINATION_FACILITY_ID`),
  KEY `RTN_FROM_CTM` (`ORIGIN_CONTACT_MECH_ID`),
  KEY `RTN_STTS_ITEM` (`STATUS_ID`),
  KEY `RTN_HDR_CUOM` (`CURRENCY_UOM_ID`),
  CONSTRAINT `RTN_FROM_CTM` FOREIGN KEY (`ORIGIN_CONTACT_MECH_ID`) REFERENCES `CONTACT_MECH` (`CONTACT_MECH_ID`),
  CONSTRAINT `RTN_FROM_PARTY` FOREIGN KEY (`FROM_PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `RTN_HDR_CUOM` FOREIGN KEY (`CURRENCY_UOM_ID`) REFERENCES `UOM` (`UOM_ID`),
  CONSTRAINT `RTN_HEAD_TYPE` FOREIGN KEY (`RETURN_HEADER_TYPE_ID`) REFERENCES `RETURN_HEADER_TYPE` (`RETURN_HEADER_TYPE_ID`),
  CONSTRAINT `RTN_STTS_ITEM` FOREIGN KEY (`STATUS_ID`) REFERENCES `STATUS_ITEM` (`STATUS_ID`),
  CONSTRAINT `RTN_TO_BACT` FOREIGN KEY (`BILLING_ACCOUNT_ID`) REFERENCES `BILLING_ACCOUNT` (`BILLING_ACCOUNT_ID`),
  CONSTRAINT `RTN_TO_FACILITY` FOREIGN KEY (`DESTINATION_FACILITY_ID`) REFERENCES `FACILITY` (`FACILITY_ID`),
  CONSTRAINT `RTN_TO_FACT` FOREIGN KEY (`FIN_ACCOUNT_ID`) REFERENCES `FIN_ACCOUNT` (`FIN_ACCOUNT_ID`),
  CONSTRAINT `RTN_TO_PARTY` FOREIGN KEY (`TO_PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `RTN_TO_PAYMETH` 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 `RETURN_HEADER_TYPE`
--

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

--
-- Table structure for table `RETURN_ITEM`
--

DROP TABLE IF EXISTS `RETURN_ITEM`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `RETURN_ITEM` (
  `RETURN_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `RETURN_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `RETURN_REASON_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `RETURN_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `RETURN_ITEM_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PRODUCT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `ORDER_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ORDER_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `STATUS_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `EXPECTED_ITEM_STATUS` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `RETURN_QUANTITY` decimal(18,6) DEFAULT NULL,
  `RECEIVED_QUANTITY` decimal(18,6) DEFAULT NULL,
  `RETURN_PRICE` decimal(18,2) DEFAULT NULL,
  `RETURN_ITEM_RESPONSE_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 (`RETURN_ID`,`RETURN_ITEM_SEQ_ID`),
  KEY `RTN_ITEM_RTN` (`RETURN_ID`),
  KEY `RTN_ITEM_REASON` (`RETURN_REASON_ID`),
  KEY `RTN_TYPE` (`RETURN_TYPE_ID`),
  KEY `RTN_ITEM_TYPE` (`RETURN_ITEM_TYPE_ID`),
  KEY `RTN_ITEM_RESP` (`RETURN_ITEM_RESPONSE_ID`),
  KEY `RTN_ITEM_ODR` (`ORDER_ID`),
  KEY `RTN_ITEM_ODRIT` (`ORDER_ID`,`ORDER_ITEM_SEQ_ID`),
  KEY `RTN_ITEM_STTSIT` (`STATUS_ID`),
  KEY `RTN_ITEM_ITSTT` (`EXPECTED_ITEM_STATUS`),
  KEY `RTN_ITEM_PROD` (`PRODUCT_ID`),
  CONSTRAINT `RTN_ITEM_ITSTT` FOREIGN KEY (`EXPECTED_ITEM_STATUS`) REFERENCES `STATUS_ITEM` (`STATUS_ID`),
  CONSTRAINT `RTN_ITEM_ODR` FOREIGN KEY (`ORDER_ID`) REFERENCES `ORDER_HEADER` (`ORDER_ID`),
  CONSTRAINT `RTN_ITEM_ODRIT` FOREIGN KEY (`ORDER_ID`, `ORDER_ITEM_SEQ_ID`) REFERENCES `ORDER_ITEM` (`ORDER_ID`, `ORDER_ITEM_SEQ_ID`),
  CONSTRAINT `RTN_ITEM_PROD` FOREIGN KEY (`PRODUCT_ID`) REFERENCES `PRODUCT` (`PRODUCT_ID`),
  CONSTRAINT `RTN_ITEM_REASON` FOREIGN KEY (`RETURN_REASON_ID`) REFERENCES `RETURN_REASON` (`RETURN_REASON_ID`),
  CONSTRAINT `RTN_ITEM_RESP` FOREIGN KEY (`RETURN_ITEM_RESPONSE_ID`) REFERENCES `RETURN_ITEM_RESPONSE` (`RETURN_ITEM_RESPONSE_ID`),
  CONSTRAINT `RTN_ITEM_RTN` FOREIGN KEY (`RETURN_ID`) REFERENCES `RETURN_HEADER` (`RETURN_ID`),
  CONSTRAINT `RTN_ITEM_STTSIT` FOREIGN KEY (`STATUS_ID`) REFERENCES `STATUS_ITEM` (`STATUS_ID`),
  CONSTRAINT `RTN_ITEM_TYPE` FOREIGN KEY (`RETURN_ITEM_TYPE_ID`) REFERENCES `RETURN_ITEM_TYPE` (`RETURN_ITEM_TYPE_ID`),
  CONSTRAINT `RTN_TYPE` FOREIGN KEY (`RETURN_TYPE_ID`) REFERENCES `RETURN_TYPE` (`RETURN_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `RETURN_ITEM_BILLING`
--

DROP TABLE IF EXISTS `RETURN_ITEM_BILLING`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `RETURN_ITEM_BILLING` (
  `RETURN_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `RETURN_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `INVOICE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `INVOICE_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `SHIPMENT_RECEIPT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `QUANTITY` decimal(18,6) DEFAULT NULL,
  `AMOUNT` decimal(18,2) DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`RETURN_ID`,`RETURN_ITEM_SEQ_ID`,`INVOICE_ID`,`INVOICE_ITEM_SEQ_ID`),
  KEY `RTN_ITBLNG_RHDR` (`RETURN_ID`),
  KEY `RTN_ITBLNG_RITM` (`RETURN_ID`,`RETURN_ITEM_SEQ_ID`),
  KEY `RETURN_ITBLNG_IITM` (`INVOICE_ID`,`INVOICE_ITEM_SEQ_ID`),
  KEY `RITBL_SHIPRCPT` (`SHIPMENT_RECEIPT_ID`),
  CONSTRAINT `RETURN_ITBLNG_IITM` FOREIGN KEY (`INVOICE_ID`, `INVOICE_ITEM_SEQ_ID`) REFERENCES `INVOICE_ITEM` (`INVOICE_ID`, `INVOICE_ITEM_SEQ_ID`),
  CONSTRAINT `RITBL_SHIPRCPT` FOREIGN KEY (`SHIPMENT_RECEIPT_ID`) REFERENCES `SHIPMENT_RECEIPT` (`RECEIPT_ID`),
  CONSTRAINT `RTN_ITBLNG_RHDR` FOREIGN KEY (`RETURN_ID`) REFERENCES `RETURN_HEADER` (`RETURN_ID`),
  CONSTRAINT `RTN_ITBLNG_RITM` FOREIGN KEY (`RETURN_ID`, `RETURN_ITEM_SEQ_ID`) REFERENCES `RETURN_ITEM` (`RETURN_ID`, `RETURN_ITEM_SEQ_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `RETURN_ITEM_RESPONSE`
--

DROP TABLE IF EXISTS `RETURN_ITEM_RESPONSE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `RETURN_ITEM_RESPONSE` (
  `RETURN_ITEM_RESPONSE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ORDER_PAYMENT_PREFERENCE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `REPLACEMENT_ORDER_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PAYMENT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `BILLING_ACCOUNT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `FIN_ACCOUNT_TRANS_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `RESPONSE_AMOUNT` decimal(18,2) DEFAULT NULL,
  `RESPONSE_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 (`RETURN_ITEM_RESPONSE_ID`),
  KEY `RTN_PAY_ORDPAYPF` (`ORDER_PAYMENT_PREFERENCE_ID`),
  KEY `RTN_RESP_NEWORD` (`REPLACEMENT_ORDER_ID`),
  KEY `RTN_PAY_PAYMENT` (`PAYMENT_ID`),
  KEY `RTN_PAY_BACT` (`BILLING_ACCOUNT_ID`),
  KEY `RTN_PAY_FINACTTX` (`FIN_ACCOUNT_TRANS_ID`),
  CONSTRAINT `RTN_PAY_BACT` FOREIGN KEY (`BILLING_ACCOUNT_ID`) REFERENCES `BILLING_ACCOUNT` (`BILLING_ACCOUNT_ID`),
  CONSTRAINT `RTN_PAY_FINACTTX` FOREIGN KEY (`FIN_ACCOUNT_TRANS_ID`) REFERENCES `FIN_ACCOUNT_TRANS` (`FIN_ACCOUNT_TRANS_ID`),
  CONSTRAINT `RTN_PAY_ORDPAYPF` FOREIGN KEY (`ORDER_PAYMENT_PREFERENCE_ID`) REFERENCES `ORDER_PAYMENT_PREFERENCE` (`ORDER_PAYMENT_PREFERENCE_ID`),
  CONSTRAINT `RTN_PAY_PAYMENT` FOREIGN KEY (`PAYMENT_ID`) REFERENCES `PAYMENT` (`PAYMENT_ID`),
  CONSTRAINT `RTN_RESP_NEWORD` FOREIGN KEY (`REPLACEMENT_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 `RETURN_ITEM_SHIPMENT`
--

DROP TABLE IF EXISTS `RETURN_ITEM_SHIPMENT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `RETURN_ITEM_SHIPMENT` (
  `RETURN_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `RETURN_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `SHIPMENT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `SHIPMENT_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `QUANTITY` decimal(18,6) DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`RETURN_ID`,`RETURN_ITEM_SEQ_ID`,`SHIPMENT_ID`,`SHIPMENT_ITEM_SEQ_ID`),
  KEY `RIT_SHPMT_RHDR` (`RETURN_ID`),
  KEY `RIT_SHPMT_RITM` (`RETURN_ID`,`RETURN_ITEM_SEQ_ID`),
  KEY `RIT_SHPMT_SHPMT` (`SHIPMENT_ID`),
  KEY `RIT_SHPMT_SHPITM` (`SHIPMENT_ID`,`SHIPMENT_ITEM_SEQ_ID`),
  CONSTRAINT `RIT_SHPMT_RHDR` FOREIGN KEY (`RETURN_ID`) REFERENCES `RETURN_HEADER` (`RETURN_ID`),
  CONSTRAINT `RIT_SHPMT_RITM` FOREIGN KEY (`RETURN_ID`, `RETURN_ITEM_SEQ_ID`) REFERENCES `RETURN_ITEM` (`RETURN_ID`, `RETURN_ITEM_SEQ_ID`),
  CONSTRAINT `RIT_SHPMT_SHPITM` FOREIGN KEY (`SHIPMENT_ID`, `SHIPMENT_ITEM_SEQ_ID`) REFERENCES `SHIPMENT_ITEM` (`SHIPMENT_ID`, `SHIPMENT_ITEM_SEQ_ID`),
  CONSTRAINT `RIT_SHPMT_SHPMT` FOREIGN KEY (`SHIPMENT_ID`) REFERENCES `SHIPMENT` (`SHIPMENT_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `RETURN_ITEM_TYPE`
--

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

--
-- Table structure for table `RETURN_ITEM_TYPE_MAP`
--

DROP TABLE IF EXISTS `RETURN_ITEM_TYPE_MAP`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `RETURN_ITEM_TYPE_MAP` (
  `RETURN_ITEM_MAP_KEY` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `RETURN_HEADER_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `RETURN_ITEM_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`RETURN_ITEM_MAP_KEY`,`RETURN_HEADER_TYPE_ID`),
  KEY `RETITMMAP_RETTYP` (`RETURN_HEADER_TYPE_ID`),
  CONSTRAINT `RETITMMAP_RETTYP` FOREIGN KEY (`RETURN_HEADER_TYPE_ID`) REFERENCES `RETURN_HEADER_TYPE` (`RETURN_HEADER_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `RETURN_REASON`
--

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

--
-- Table structure for table `RETURN_STATUS`
--

DROP TABLE IF EXISTS `RETURN_STATUS`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `RETURN_STATUS` (
  `RETURN_STATUS_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `STATUS_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `RETURN_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `RETURN_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `CHANGE_BY_USER_LOGIN_ID` varchar(250) 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 (`RETURN_STATUS_ID`),
  KEY `RTN_STTS_STTS` (`STATUS_ID`),
  KEY `RTN_STTS_RTN` (`RETURN_ID`),
  KEY `RTN_STTS_USRLGN` (`CHANGE_BY_USER_LOGIN_ID`),
  CONSTRAINT `RTN_STTS_RTN` FOREIGN KEY (`RETURN_ID`) REFERENCES `RETURN_HEADER` (`RETURN_ID`),
  CONSTRAINT `RTN_STTS_STTS` FOREIGN KEY (`STATUS_ID`) REFERENCES `STATUS_ITEM` (`STATUS_ID`),
  CONSTRAINT `RTN_STTS_USRLGN` FOREIGN KEY (`CHANGE_BY_USER_LOGIN_ID`) REFERENCES `USER_LOGIN` (`USER_LOGIN_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `RETURN_TYPE`
--

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

--
-- Table structure for table `ROLE_TYPE`
--

DROP TABLE IF EXISTS `ROLE_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ROLE_TYPE` (
  `ROLE_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 (`ROLE_TYPE_ID`),
  KEY `ROLE_TYPE_PAR` (`PARENT_TYPE_ID`),
  CONSTRAINT `ROLE_TYPE_PAR` FOREIGN KEY (`PARENT_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 `ROLE_TYPE_ATTR`
--

DROP TABLE IF EXISTS `ROLE_TYPE_ATTR`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ROLE_TYPE_ATTR` (
  `ROLE_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 (`ROLE_TYPE_ID`,`ATTR_NAME`),
  KEY `ROLE_TYPATR_RTYP` (`ROLE_TYPE_ID`),
  CONSTRAINT `ROLE_TYPATR_RTYP` 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 `RUNTIME_DATA`
--

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

--
-- Table structure for table `SALARY_STEP`
--

DROP TABLE IF EXISTS `SALARY_STEP`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SALARY_STEP` (
  `SALARY_STEP_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PAY_GRADE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `DATE_MODIFIED` datetime 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 (`SALARY_STEP_SEQ_ID`,`PAY_GRADE_ID`),
  KEY `SLRY_STP_PGRD` (`PAY_GRADE_ID`),
  CONSTRAINT `SLRY_STP_PGRD` FOREIGN KEY (`PAY_GRADE_ID`) REFERENCES `PAY_GRADE` (`PAY_GRADE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `SALES_FORECAST`
--

DROP TABLE IF EXISTS `SALES_FORECAST`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SALES_FORECAST` (
  `SALES_FORECAST_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARENT_SALES_FORECAST_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ORGANIZATION_PARTY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `INTERNAL_PARTY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `CUSTOM_TIME_PERIOD_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `CURRENCY_UOM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `QUOTA_AMOUNT` decimal(18,2) DEFAULT NULL,
  `FORECAST_AMOUNT` decimal(18,2) DEFAULT NULL,
  `BEST_CASE_AMOUNT` decimal(18,2) DEFAULT NULL,
  `CLOSED_AMOUNT` decimal(18,2) DEFAULT NULL,
  `PERCENT_OF_QUOTA_FORECAST` decimal(18,6) DEFAULT NULL,
  `PERCENT_OF_QUOTA_CLOSED` decimal(18,6) DEFAULT NULL,
  `PIPELINE_AMOUNT` decimal(18,2) DEFAULT NULL,
  `CREATED_BY_USER_LOGIN_ID` varchar(250) COLLATE latin1_general_cs DEFAULT NULL,
  `MODIFIED_BY_USER_LOGIN_ID` varchar(250) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`SALES_FORECAST_ID`),
  KEY `SALES4C_PARENT` (`PARENT_SALES_FORECAST_ID`),
  KEY `SALES4C_ORG_PARTY` (`ORGANIZATION_PARTY_ID`),
  KEY `SALES4C_INT_PARTY` (`INTERNAL_PARTY_ID`),
  KEY `SALES4C_TIME_PER` (`CUSTOM_TIME_PERIOD_ID`),
  KEY `SALES4C_CUR_UOM` (`CURRENCY_UOM_ID`),
  KEY `SALES4C_CRT_USER` (`CREATED_BY_USER_LOGIN_ID`),
  KEY `SALES4C_MOD_USER` (`MODIFIED_BY_USER_LOGIN_ID`),
  CONSTRAINT `SALES4C_CRT_USER` FOREIGN KEY (`CREATED_BY_USER_LOGIN_ID`) REFERENCES `USER_LOGIN` (`USER_LOGIN_ID`),
  CONSTRAINT `SALES4C_CUR_UOM` FOREIGN KEY (`CURRENCY_UOM_ID`) REFERENCES `UOM` (`UOM_ID`),
  CONSTRAINT `SALES4C_INT_PARTY` FOREIGN KEY (`INTERNAL_PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `SALES4C_MOD_USER` FOREIGN KEY (`MODIFIED_BY_USER_LOGIN_ID`) REFERENCES `USER_LOGIN` (`USER_LOGIN_ID`),
  CONSTRAINT `SALES4C_ORG_PARTY` FOREIGN KEY (`ORGANIZATION_PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `SALES4C_PARENT` FOREIGN KEY (`PARENT_SALES_FORECAST_ID`) REFERENCES `SALES_FORECAST` (`SALES_FORECAST_ID`),
  CONSTRAINT `SALES4C_TIME_PER` 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 `SALES_FORECAST_DETAIL`
--

DROP TABLE IF EXISTS `SALES_FORECAST_DETAIL`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SALES_FORECAST_DETAIL` (
  `SALES_FORECAST_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `SALES_FORECAST_DETAIL_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `AMOUNT` decimal(18,2) DEFAULT NULL,
  `QUANTITY_UOM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `QUANTITY` decimal(18,6) DEFAULT NULL,
  `PRODUCT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PRODUCT_CATEGORY_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 (`SALES_FORECAST_ID`,`SALES_FORECAST_DETAIL_ID`),
  KEY `SALES4CDTL_SALES4C` (`SALES_FORECAST_ID`),
  KEY `SALES4CDTL_QTY_UOM` (`QUANTITY_UOM_ID`),
  KEY `SALES4CDTL_PROD` (`PRODUCT_ID`),
  KEY `SALES4CDTL_PCTGRY` (`PRODUCT_CATEGORY_ID`),
  CONSTRAINT `SALES4CDTL_PCTGRY` FOREIGN KEY (`PRODUCT_CATEGORY_ID`) REFERENCES `PRODUCT_CATEGORY` (`PRODUCT_CATEGORY_ID`),
  CONSTRAINT `SALES4CDTL_PROD` FOREIGN KEY (`PRODUCT_ID`) REFERENCES `PRODUCT` (`PRODUCT_ID`),
  CONSTRAINT `SALES4CDTL_QTY_UOM` FOREIGN KEY (`QUANTITY_UOM_ID`) REFERENCES `UOM` (`UOM_ID`),
  CONSTRAINT `SALES4CDTL_SALES4C` FOREIGN KEY (`SALES_FORECAST_ID`) REFERENCES `SALES_FORECAST` (`SALES_FORECAST_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `SALES_FORECAST_HISTORY`
--

DROP TABLE IF EXISTS `SALES_FORECAST_HISTORY`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SALES_FORECAST_HISTORY` (
  `SALES_FORECAST_HISTORY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `SALES_FORECAST_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PARENT_SALES_FORECAST_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ORGANIZATION_PARTY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `INTERNAL_PARTY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `CUSTOM_TIME_PERIOD_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `CURRENCY_UOM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `QUOTA_AMOUNT` decimal(18,2) DEFAULT NULL,
  `FORECAST_AMOUNT` decimal(18,2) DEFAULT NULL,
  `BEST_CASE_AMOUNT` decimal(18,2) DEFAULT NULL,
  `CLOSED_AMOUNT` decimal(18,2) DEFAULT NULL,
  `PERCENT_OF_QUOTA_FORECAST` decimal(18,6) DEFAULT NULL,
  `PERCENT_OF_QUOTA_CLOSED` decimal(18,6) DEFAULT NULL,
  `CHANGE_NOTE` longtext COLLATE latin1_general_cs,
  `MODIFIED_BY_USER_LOGIN_ID` varchar(250) COLLATE latin1_general_cs DEFAULT NULL,
  `MODIFIED_TIMESTAMP` 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 (`SALES_FORECAST_HISTORY_ID`),
  KEY `SALES4CH_SALES4C` (`SALES_FORECAST_ID`),
  KEY `SALES4CH_ORG_PARTY` (`ORGANIZATION_PARTY_ID`),
  KEY `SALES4CH_INT_PARTY` (`INTERNAL_PARTY_ID`),
  KEY `SALES4CH_TIME_PER` (`CUSTOM_TIME_PERIOD_ID`),
  KEY `SALES4CH_CUR_UOM` (`CURRENCY_UOM_ID`),
  KEY `SALES4CH_MOD_USER` (`MODIFIED_BY_USER_LOGIN_ID`),
  CONSTRAINT `SALES4CH_CUR_UOM` FOREIGN KEY (`CURRENCY_UOM_ID`) REFERENCES `UOM` (`UOM_ID`),
  CONSTRAINT `SALES4CH_INT_PARTY` FOREIGN KEY (`INTERNAL_PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `SALES4CH_MOD_USER` FOREIGN KEY (`MODIFIED_BY_USER_LOGIN_ID`) REFERENCES `USER_LOGIN` (`USER_LOGIN_ID`),
  CONSTRAINT `SALES4CH_ORG_PARTY` FOREIGN KEY (`ORGANIZATION_PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `SALES4CH_SALES4C` FOREIGN KEY (`SALES_FORECAST_ID`) REFERENCES `SALES_FORECAST` (`SALES_FORECAST_ID`),
  CONSTRAINT `SALES4CH_TIME_PER` 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 `SALES_OPPORTUNITY`
--

DROP TABLE IF EXISTS `SALES_OPPORTUNITY`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SALES_OPPORTUNITY` (
  `SALES_OPPORTUNITY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `OPPORTUNITY_NAME` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `DESCRIPTION` longtext COLLATE latin1_general_cs,
  `NEXT_STEP` longtext COLLATE latin1_general_cs,
  `NEXT_STEP_DATE` datetime DEFAULT NULL,
  `ESTIMATED_AMOUNT` decimal(18,2) DEFAULT NULL,
  `ESTIMATED_PROBABILITY` decimal(18,6) DEFAULT NULL,
  `CURRENCY_UOM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `MARKETING_CAMPAIGN_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `DATA_SOURCE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ESTIMATED_CLOSE_DATE` datetime DEFAULT NULL,
  `OPPORTUNITY_STAGE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `TYPE_ENUM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `CREATED_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 (`SALES_OPPORTUNITY_ID`),
  KEY `SLSOPP_CRNCY_UOM` (`CURRENCY_UOM_ID`),
  KEY `SLSOPP_STAGE` (`OPPORTUNITY_STAGE_ID`),
  KEY `SLSOPP_TYP_ENUM` (`TYPE_ENUM_ID`),
  KEY `SLSOPP_MKTGCMPG` (`MARKETING_CAMPAIGN_ID`),
  KEY `SLSOPP_USRLGN` (`CREATED_BY_USER_LOGIN`),
  CONSTRAINT `SLSOPP_CRNCY_UOM` FOREIGN KEY (`CURRENCY_UOM_ID`) REFERENCES `UOM` (`UOM_ID`),
  CONSTRAINT `SLSOPP_MKTGCMPG` FOREIGN KEY (`MARKETING_CAMPAIGN_ID`) REFERENCES `MARKETING_CAMPAIGN` (`MARKETING_CAMPAIGN_ID`),
  CONSTRAINT `SLSOPP_STAGE` FOREIGN KEY (`OPPORTUNITY_STAGE_ID`) REFERENCES `SALES_OPPORTUNITY_STAGE` (`OPPORTUNITY_STAGE_ID`),
  CONSTRAINT `SLSOPP_TYP_ENUM` FOREIGN KEY (`TYPE_ENUM_ID`) REFERENCES `ENUMERATION` (`ENUM_ID`),
  CONSTRAINT `SLSOPP_USRLGN` FOREIGN KEY (`CREATED_BY_USER_LOGIN`) REFERENCES `USER_LOGIN` (`USER_LOGIN_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `SALES_OPPORTUNITY_COMPETITOR`
--

DROP TABLE IF EXISTS `SALES_OPPORTUNITY_COMPETITOR`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SALES_OPPORTUNITY_COMPETITOR` (
  `SALES_OPPORTUNITY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `COMPETITOR_PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `POSITION_ENUM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `STRENGTHS` longtext COLLATE latin1_general_cs,
  `WEAKNESSES` 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 (`SALES_OPPORTUNITY_ID`,`COMPETITOR_PARTY_ID`),
  KEY `SOPPCOMP_SOPP` (`SALES_OPPORTUNITY_ID`),
  CONSTRAINT `SOPPCOMP_SOPP` FOREIGN KEY (`SALES_OPPORTUNITY_ID`) REFERENCES `SALES_OPPORTUNITY` (`SALES_OPPORTUNITY_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `SALES_OPPORTUNITY_HISTORY`
--

DROP TABLE IF EXISTS `SALES_OPPORTUNITY_HISTORY`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SALES_OPPORTUNITY_HISTORY` (
  `SALES_OPPORTUNITY_HISTORY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `SALES_OPPORTUNITY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `DESCRIPTION` longtext COLLATE latin1_general_cs,
  `NEXT_STEP` longtext COLLATE latin1_general_cs,
  `ESTIMATED_AMOUNT` decimal(18,2) DEFAULT NULL,
  `ESTIMATED_PROBABILITY` decimal(18,6) DEFAULT NULL,
  `CURRENCY_UOM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ESTIMATED_CLOSE_DATE` datetime DEFAULT NULL,
  `OPPORTUNITY_STAGE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `CHANGE_NOTE` longtext COLLATE latin1_general_cs,
  `MODIFIED_BY_USER_LOGIN` varchar(250) COLLATE latin1_general_cs DEFAULT NULL,
  `MODIFIED_TIMESTAMP` 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 (`SALES_OPPORTUNITY_HISTORY_ID`),
  KEY `SLOPHI_CRNCY_UOM` (`CURRENCY_UOM_ID`),
  KEY `SLOPHI_STAGE` (`OPPORTUNITY_STAGE_ID`),
  KEY `SLOPHI_SLSOPP` (`SALES_OPPORTUNITY_ID`),
  KEY `SLOPHI_USRLGN` (`MODIFIED_BY_USER_LOGIN`),
  CONSTRAINT `SLOPHI_CRNCY_UOM` FOREIGN KEY (`CURRENCY_UOM_ID`) REFERENCES `UOM` (`UOM_ID`),
  CONSTRAINT `SLOPHI_SLSOPP` FOREIGN KEY (`SALES_OPPORTUNITY_ID`) REFERENCES `SALES_OPPORTUNITY` (`SALES_OPPORTUNITY_ID`),
  CONSTRAINT `SLOPHI_STAGE` FOREIGN KEY (`OPPORTUNITY_STAGE_ID`) REFERENCES `SALES_OPPORTUNITY_STAGE` (`OPPORTUNITY_STAGE_ID`),
  CONSTRAINT `SLOPHI_USRLGN` FOREIGN KEY (`MODIFIED_BY_USER_LOGIN`) REFERENCES `USER_LOGIN` (`USER_LOGIN_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `SALES_OPPORTUNITY_QUOTE`
--

DROP TABLE IF EXISTS `SALES_OPPORTUNITY_QUOTE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SALES_OPPORTUNITY_QUOTE` (
  `SALES_OPPORTUNITY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `QUOTE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`SALES_OPPORTUNITY_ID`,`QUOTE_ID`),
  KEY `SOPPQTE_SOPP` (`SALES_OPPORTUNITY_ID`),
  KEY `SOPPQTE_QTE` (`QUOTE_ID`),
  CONSTRAINT `SOPPQTE_QTE` FOREIGN KEY (`QUOTE_ID`) REFERENCES `QUOTE` (`QUOTE_ID`),
  CONSTRAINT `SOPPQTE_SOPP` FOREIGN KEY (`SALES_OPPORTUNITY_ID`) REFERENCES `SALES_OPPORTUNITY` (`SALES_OPPORTUNITY_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `SALES_OPPORTUNITY_ROLE`
--

DROP TABLE IF EXISTS `SALES_OPPORTUNITY_ROLE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SALES_OPPORTUNITY_ROLE` (
  `SALES_OPPORTUNITY_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 (`SALES_OPPORTUNITY_ID`,`PARTY_ID`,`ROLE_TYPE_ID`),
  KEY `SLSOPPRL_SLSOPP` (`SALES_OPPORTUNITY_ID`),
  KEY `SLSOPPRL_PARTY` (`PARTY_ID`),
  KEY `SLSOPPRL_ROLETYPE` (`ROLE_TYPE_ID`),
  KEY `SLSOPPRL_PTYROLE` (`PARTY_ID`,`ROLE_TYPE_ID`),
  CONSTRAINT `SLSOPPRL_PARTY` FOREIGN KEY (`PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `SLSOPPRL_PTYROLE` FOREIGN KEY (`PARTY_ID`, `ROLE_TYPE_ID`) REFERENCES `PARTY_ROLE` (`PARTY_ID`, `ROLE_TYPE_ID`),
  CONSTRAINT `SLSOPPRL_ROLETYPE` FOREIGN KEY (`ROLE_TYPE_ID`) REFERENCES `ROLE_TYPE` (`ROLE_TYPE_ID`),
  CONSTRAINT `SLSOPPRL_SLSOPP` FOREIGN KEY (`SALES_OPPORTUNITY_ID`) REFERENCES `SALES_OPPORTUNITY` (`SALES_OPPORTUNITY_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `SALES_OPPORTUNITY_STAGE`
--

DROP TABLE IF EXISTS `SALES_OPPORTUNITY_STAGE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SALES_OPPORTUNITY_STAGE` (
  `OPPORTUNITY_STAGE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `DEFAULT_PROBABILITY` decimal(18,6) DEFAULT NULL,
  `SEQUENCE_NUM` decimal(20,0) DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`OPPORTUNITY_STAGE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `SALES_OPPORTUNITY_TRCK_CODE`
--

DROP TABLE IF EXISTS `SALES_OPPORTUNITY_TRCK_CODE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SALES_OPPORTUNITY_TRCK_CODE` (
  `SALES_OPPORTUNITY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `TRACKING_CODE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `RECEIVED_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 (`SALES_OPPORTUNITY_ID`,`TRACKING_CODE_ID`),
  KEY `SOPPTRKCD_SOPP` (`SALES_OPPORTUNITY_ID`),
  CONSTRAINT `SOPPTRKCD_SOPP` FOREIGN KEY (`SALES_OPPORTUNITY_ID`) REFERENCES `SALES_OPPORTUNITY` (`SALES_OPPORTUNITY_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `SALES_OPPORTUNITY_WORK_EFFORT`
--

DROP TABLE IF EXISTS `SALES_OPPORTUNITY_WORK_EFFORT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SALES_OPPORTUNITY_WORK_EFFORT` (
  `SALES_OPPORTUNITY_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 (`SALES_OPPORTUNITY_ID`,`WORK_EFFORT_ID`),
  KEY `SOPPWEFF_SOPP` (`SALES_OPPORTUNITY_ID`),
  KEY `SOPPWEFF_WEFF` (`WORK_EFFORT_ID`),
  CONSTRAINT `SOPPWEFF_SOPP` FOREIGN KEY (`SALES_OPPORTUNITY_ID`) REFERENCES `SALES_OPPORTUNITY` (`SALES_OPPORTUNITY_ID`),
  CONSTRAINT `SOPPWEFF_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 `SALE_TYPE`
--

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

--
-- Table structure for table `SECURITY_GROUP`
--

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

--
-- Table structure for table `SECURITY_GROUP_PERMISSION`
--

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

--
-- Table structure for table `SECURITY_PERMISSION`
--

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

--
-- Table structure for table `SEGMENT_GROUP`
--

DROP TABLE IF EXISTS `SEGMENT_GROUP`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SEGMENT_GROUP` (
  `SEGMENT_GROUP_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `SEGMENT_GROUP_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `PRODUCT_STORE_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 (`SEGMENT_GROUP_ID`),
  KEY `SGMTGRP_TYPE` (`SEGMENT_GROUP_TYPE_ID`),
  KEY `SGMTGRP_PRST` (`PRODUCT_STORE_ID`),
  CONSTRAINT `SGMTGRP_PRST` FOREIGN KEY (`PRODUCT_STORE_ID`) REFERENCES `PRODUCT_STORE` (`PRODUCT_STORE_ID`),
  CONSTRAINT `SGMTGRP_TYPE` FOREIGN KEY (`SEGMENT_GROUP_TYPE_ID`) REFERENCES `SEGMENT_GROUP_TYPE` (`SEGMENT_GROUP_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `SEGMENT_GROUP_CLASSIFICATION`
--

DROP TABLE IF EXISTS `SEGMENT_GROUP_CLASSIFICATION`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SEGMENT_GROUP_CLASSIFICATION` (
  `SEGMENT_GROUP_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARTY_CLASSIFICATION_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 (`SEGMENT_GROUP_ID`,`PARTY_CLASSIFICATION_GROUP_ID`),
  KEY `SGMTGRPCLS_SGGP` (`SEGMENT_GROUP_ID`),
  KEY `SGMTGRPCLS_PCGP` (`PARTY_CLASSIFICATION_GROUP_ID`),
  CONSTRAINT `SGMTGRPCLS_PCGP` FOREIGN KEY (`PARTY_CLASSIFICATION_GROUP_ID`) REFERENCES `PARTY_CLASSIFICATION_GROUP` (`PARTY_CLASSIFICATION_GROUP_ID`),
  CONSTRAINT `SGMTGRPCLS_SGGP` FOREIGN KEY (`SEGMENT_GROUP_ID`) REFERENCES `SEGMENT_GROUP` (`SEGMENT_GROUP_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `SEGMENT_GROUP_GEO`
--

DROP TABLE IF EXISTS `SEGMENT_GROUP_GEO`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SEGMENT_GROUP_GEO` (
  `SEGMENT_GROUP_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 (`SEGMENT_GROUP_ID`,`GEO_ID`),
  KEY `SGMTGRPGEO_SGGP` (`SEGMENT_GROUP_ID`),
  KEY `SGMTGRPGEO_GEO` (`GEO_ID`),
  CONSTRAINT `SGMTGRPGEO_GEO` FOREIGN KEY (`GEO_ID`) REFERENCES `GEO` (`GEO_ID`),
  CONSTRAINT `SGMTGRPGEO_SGGP` FOREIGN KEY (`SEGMENT_GROUP_ID`) REFERENCES `SEGMENT_GROUP` (`SEGMENT_GROUP_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `SEGMENT_GROUP_ROLE`
--

DROP TABLE IF EXISTS `SEGMENT_GROUP_ROLE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SEGMENT_GROUP_ROLE` (
  `SEGMENT_GROUP_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ROLE_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`SEGMENT_GROUP_ID`,`PARTY_ID`,`ROLE_TYPE_ID`),
  KEY `SGMTGRPRL_SGGP` (`SEGMENT_GROUP_ID`),
  KEY `SGMTGRPRL_PRLE` (`PARTY_ID`,`ROLE_TYPE_ID`),
  CONSTRAINT `SGMTGRPRL_PRLE` FOREIGN KEY (`PARTY_ID`, `ROLE_TYPE_ID`) REFERENCES `PARTY_ROLE` (`PARTY_ID`, `ROLE_TYPE_ID`),
  CONSTRAINT `SGMTGRPRL_SGGP` FOREIGN KEY (`SEGMENT_GROUP_ID`) REFERENCES `SEGMENT_GROUP` (`SEGMENT_GROUP_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `SEGMENT_GROUP_TYPE`
--

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

--
-- Table structure for table `SEQUENCE_VALUE_ITEM`
--

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

--
-- Table structure for table `SERVER_HIT`
--

DROP TABLE IF EXISTS `SERVER_HIT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SERVER_HIT` (
  `VISIT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CONTENT_ID` varchar(250) COLLATE latin1_general_cs NOT NULL,
  `HIT_START_DATE_TIME` datetime NOT NULL,
  `HIT_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `NUM_OF_BYTES` decimal(20,0) DEFAULT NULL,
  `RUNNING_TIME_MILLIS` decimal(20,0) DEFAULT NULL,
  `USER_LOGIN_ID` varchar(250) COLLATE latin1_general_cs DEFAULT NULL,
  `STATUS_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `REQUEST_URL` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `REFERRER_URL` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `SERVER_IP_ADDRESS` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SERVER_HOST_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,
  `INTERNAL_CONTENT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ID_BY_IP_CONTACT_MECH_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `REF_BY_WEB_CONTACT_MECH_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  PRIMARY KEY (`VISIT_ID`,`CONTENT_ID`,`HIT_START_DATE_TIME`,`HIT_TYPE_ID`),
  KEY `SERVER_HIT_SHTYP` (`HIT_TYPE_ID`),
  KEY `SERVER_HIT_VISIT` (`VISIT_ID`),
  KEY `SERVER_HIT_STATUS` (`STATUS_ID`),
  KEY `SERVER_HIT_USER` (`USER_LOGIN_ID`),
  KEY `SERVER_HIT_PARTY` (`PARTY_ID`),
  KEY `SERVER_HIT_IDBYIP` (`ID_BY_IP_CONTACT_MECH_ID`),
  KEY `SERVER_HIT_REFWEB` (`REF_BY_WEB_CONTACT_MECH_ID`),
  KEY `SERVER_HIT_CNT` (`INTERNAL_CONTENT_ID`),
  CONSTRAINT `SERVER_HIT_CNT` FOREIGN KEY (`INTERNAL_CONTENT_ID`) REFERENCES `CONTENT` (`CONTENT_ID`),
  CONSTRAINT `SERVER_HIT_IDBYIP` FOREIGN KEY (`ID_BY_IP_CONTACT_MECH_ID`) REFERENCES `CONTACT_MECH` (`CONTACT_MECH_ID`),
  CONSTRAINT `SERVER_HIT_PARTY` FOREIGN KEY (`PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `SERVER_HIT_REFWEB` FOREIGN KEY (`REF_BY_WEB_CONTACT_MECH_ID`) REFERENCES `CONTACT_MECH` (`CONTACT_MECH_ID`),
  CONSTRAINT `SERVER_HIT_SHTYP` FOREIGN KEY (`HIT_TYPE_ID`) REFERENCES `SERVER_HIT_TYPE` (`HIT_TYPE_ID`),
  CONSTRAINT `SERVER_HIT_STATUS` FOREIGN KEY (`STATUS_ID`) REFERENCES `STATUS_ITEM` (`STATUS_ID`),
  CONSTRAINT `SERVER_HIT_USER` FOREIGN KEY (`USER_LOGIN_ID`) REFERENCES `USER_LOGIN` (`USER_LOGIN_ID`),
  CONSTRAINT `SERVER_HIT_VISIT` 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 `SERVER_HIT_BIN`
--

DROP TABLE IF EXISTS `SERVER_HIT_BIN`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SERVER_HIT_BIN` (
  `SERVER_HIT_BIN_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CONTENT_ID` varchar(250) COLLATE latin1_general_cs DEFAULT NULL,
  `HIT_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SERVER_IP_ADDRESS` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SERVER_HOST_NAME` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `BIN_START_DATE_TIME` datetime DEFAULT NULL,
  `BIN_END_DATE_TIME` datetime DEFAULT NULL,
  `NUMBER_HITS` decimal(20,0) DEFAULT NULL,
  `TOTAL_TIME_MILLIS` decimal(20,0) DEFAULT NULL,
  `MIN_TIME_MILLIS` decimal(20,0) DEFAULT NULL,
  `MAX_TIME_MILLIS` 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,
  `INTERNAL_CONTENT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  PRIMARY KEY (`SERVER_HIT_BIN_ID`),
  KEY `SERVER_HBIN_TYPE` (`HIT_TYPE_ID`),
  KEY `SERVER_HBIN_CNT` (`INTERNAL_CONTENT_ID`),
  CONSTRAINT `SERVER_HBIN_CNT` FOREIGN KEY (`INTERNAL_CONTENT_ID`) REFERENCES `CONTENT` (`CONTENT_ID`),
  CONSTRAINT `SERVER_HBIN_TYPE` FOREIGN KEY (`HIT_TYPE_ID`) REFERENCES `SERVER_HIT_TYPE` (`HIT_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `SERVER_HIT_TYPE`
--

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

--
-- Table structure for table `SERVICE_SEMAPHORE`
--

DROP TABLE IF EXISTS `SERVICE_SEMAPHORE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SERVICE_SEMAPHORE` (
  `SERVICE_NAME` varchar(100) COLLATE latin1_general_cs NOT NULL,
  `LOCKED_BY_INSTANCE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `LOCK_THREAD` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `LOCK_TIME` datetime DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`SERVICE_NAME`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `SETTLEMENT_TERM`
--

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

--
-- Table structure for table `SHIPMENT`
--

DROP TABLE IF EXISTS `SHIPMENT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SHIPMENT` (
  `SHIPMENT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `SHIPMENT_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `STATUS_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PRIMARY_ORDER_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PRIMARY_RETURN_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PRIMARY_SHIP_GROUP_SEQ_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PICKLIST_BIN_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ESTIMATED_READY_DATE` datetime DEFAULT NULL,
  `ESTIMATED_SHIP_DATE` datetime DEFAULT NULL,
  `ESTIMATED_SHIP_WORK_EFF_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ESTIMATED_ARRIVAL_DATE` datetime DEFAULT NULL,
  `ESTIMATED_ARRIVAL_WORK_EFF_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `LATEST_CANCEL_DATE` datetime DEFAULT NULL,
  `ESTIMATED_SHIP_COST` decimal(18,2) DEFAULT NULL,
  `CURRENCY_UOM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `HANDLING_INSTRUCTIONS` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `ORIGIN_FACILITY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `DESTINATION_FACILITY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ORIGIN_CONTACT_MECH_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ORIGIN_TELECOM_NUMBER_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `DESTINATION_CONTACT_MECH_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `DESTINATION_TELECOM_NUMBER_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PARTY_ID_TO` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PARTY_ID_FROM` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ADDITIONAL_SHIPPING_CHARGE` decimal(18,2) DEFAULT NULL,
  `ADDTL_SHIPPING_CHARGE_DESC` 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 (`SHIPMENT_ID`),
  KEY `SHPMNT_TYPE` (`SHIPMENT_TYPE_ID`),
  KEY `SHPMNT_STTS` (`STATUS_ID`),
  KEY `SHPMNT_ESHWEFF` (`ESTIMATED_SHIP_WORK_EFF_ID`),
  KEY `SHPMNT_EARRWEFF` (`ESTIMATED_ARRIVAL_WORK_EFF_ID`),
  KEY `SHPMNT_CUOM` (`CURRENCY_UOM_ID`),
  KEY `SHPMNT_OFAC` (`ORIGIN_FACILITY_ID`),
  KEY `SHPMNT_DFAC` (`DESTINATION_FACILITY_ID`),
  KEY `SHPMNT_OPAD` (`ORIGIN_CONTACT_MECH_ID`),
  KEY `SHPMNT_OTCN` (`ORIGIN_TELECOM_NUMBER_ID`),
  KEY `SHPMNT_DPAD` (`DESTINATION_CONTACT_MECH_ID`),
  KEY `SHPMNT_DTCN` (`DESTINATION_TELECOM_NUMBER_ID`),
  KEY `SHPMNT_PODR` (`PRIMARY_ORDER_ID`),
  KEY `SHPMNT_PRTNHDR` (`PRIMARY_RETURN_ID`),
  KEY `SHPMNT_PKLSTBIN` (`PICKLIST_BIN_ID`),
  KEY `SHPMNT_PRTYTO` (`PARTY_ID_TO`),
  KEY `SHPMNT_PRTYFM` (`PARTY_ID_FROM`),
  CONSTRAINT `SHPMNT_CUOM` FOREIGN KEY (`CURRENCY_UOM_ID`) REFERENCES `UOM` (`UOM_ID`),
  CONSTRAINT `SHPMNT_DFAC` FOREIGN KEY (`DESTINATION_FACILITY_ID`) REFERENCES `FACILITY` (`FACILITY_ID`),
  CONSTRAINT `SHPMNT_DPAD` FOREIGN KEY (`DESTINATION_CONTACT_MECH_ID`) REFERENCES `POSTAL_ADDRESS` (`CONTACT_MECH_ID`),
  CONSTRAINT `SHPMNT_DTCN` FOREIGN KEY (`DESTINATION_TELECOM_NUMBER_ID`) REFERENCES `TELECOM_NUMBER` (`CONTACT_MECH_ID`),
  CONSTRAINT `SHPMNT_EARRWEFF` FOREIGN KEY (`ESTIMATED_ARRIVAL_WORK_EFF_ID`) REFERENCES `WORK_EFFORT` (`WORK_EFFORT_ID`),
  CONSTRAINT `SHPMNT_ESHWEFF` FOREIGN KEY (`ESTIMATED_SHIP_WORK_EFF_ID`) REFERENCES `WORK_EFFORT` (`WORK_EFFORT_ID`),
  CONSTRAINT `SHPMNT_OFAC` FOREIGN KEY (`ORIGIN_FACILITY_ID`) REFERENCES `FACILITY` (`FACILITY_ID`),
  CONSTRAINT `SHPMNT_OPAD` FOREIGN KEY (`ORIGIN_CONTACT_MECH_ID`) REFERENCES `POSTAL_ADDRESS` (`CONTACT_MECH_ID`),
  CONSTRAINT `SHPMNT_OTCN` FOREIGN KEY (`ORIGIN_TELECOM_NUMBER_ID`) REFERENCES `TELECOM_NUMBER` (`CONTACT_MECH_ID`),
  CONSTRAINT `SHPMNT_PKLSTBIN` FOREIGN KEY (`PICKLIST_BIN_ID`) REFERENCES `PICKLIST_BIN` (`PICKLIST_BIN_ID`),
  CONSTRAINT `SHPMNT_PODR` FOREIGN KEY (`PRIMARY_ORDER_ID`) REFERENCES `ORDER_HEADER` (`ORDER_ID`),
  CONSTRAINT `SHPMNT_PRTNHDR` FOREIGN KEY (`PRIMARY_RETURN_ID`) REFERENCES `RETURN_HEADER` (`RETURN_ID`),
  CONSTRAINT `SHPMNT_PRTYFM` FOREIGN KEY (`PARTY_ID_FROM`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `SHPMNT_PRTYTO` FOREIGN KEY (`PARTY_ID_TO`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `SHPMNT_STTS` FOREIGN KEY (`STATUS_ID`) REFERENCES `STATUS_ITEM` (`STATUS_ID`),
  CONSTRAINT `SHPMNT_TYPE` FOREIGN KEY (`SHIPMENT_TYPE_ID`) REFERENCES `SHIPMENT_TYPE` (`SHIPMENT_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `SHIPMENT_ATTRIBUTE`
--

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

--
-- Table structure for table `SHIPMENT_BOX_TYPE`
--

DROP TABLE IF EXISTS `SHIPMENT_BOX_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SHIPMENT_BOX_TYPE` (
  `SHIPMENT_BOX_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `DIMENSION_UOM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `BOX_LENGTH` decimal(18,6) DEFAULT NULL,
  `BOX_WIDTH` decimal(18,6) DEFAULT NULL,
  `BOX_HEIGHT` decimal(18,6) DEFAULT NULL,
  `WEIGHT_UOM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `BOX_WEIGHT` 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 (`SHIPMENT_BOX_TYPE_ID`),
  KEY `SHMT_BXTP_DUOM` (`DIMENSION_UOM_ID`),
  KEY `SHMT_BXTP_WUOM` (`WEIGHT_UOM_ID`),
  CONSTRAINT `SHMT_BXTP_DUOM` FOREIGN KEY (`DIMENSION_UOM_ID`) REFERENCES `UOM` (`UOM_ID`),
  CONSTRAINT `SHMT_BXTP_WUOM` FOREIGN KEY (`WEIGHT_UOM_ID`) REFERENCES `UOM` (`UOM_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `SHIPMENT_CONTACT_MECH`
--

DROP TABLE IF EXISTS `SHIPMENT_CONTACT_MECH`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SHIPMENT_CONTACT_MECH` (
  `SHIPMENT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `SHIPMENT_CONTACT_MECH_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CONTACT_MECH_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`SHIPMENT_ID`,`SHIPMENT_CONTACT_MECH_TYPE_ID`),
  KEY `SHPMT_CMECH` (`SHIPMENT_ID`),
  KEY `SHPMT_CMECH_CM` (`CONTACT_MECH_ID`),
  KEY `SHPMT_CMECH_TYPE` (`SHIPMENT_CONTACT_MECH_TYPE_ID`),
  CONSTRAINT `SHPMT_CMECH` FOREIGN KEY (`SHIPMENT_ID`) REFERENCES `SHIPMENT` (`SHIPMENT_ID`),
  CONSTRAINT `SHPMT_CMECH_CM` FOREIGN KEY (`CONTACT_MECH_ID`) REFERENCES `CONTACT_MECH` (`CONTACT_MECH_ID`),
  CONSTRAINT `SHPMT_CMECH_TYPE` FOREIGN KEY (`SHIPMENT_CONTACT_MECH_TYPE_ID`) REFERENCES `SHIPMENT_CONTACT_MECH_TYPE` (`SHIPMENT_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 `SHIPMENT_CONTACT_MECH_TYPE`
--

DROP TABLE IF EXISTS `SHIPMENT_CONTACT_MECH_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SHIPMENT_CONTACT_MECH_TYPE` (
  `SHIPMENT_CONTACT_MECH_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 (`SHIPMENT_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 `SHIPMENT_COST_ESTIMATE`
--

DROP TABLE IF EXISTS `SHIPMENT_COST_ESTIMATE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SHIPMENT_COST_ESTIMATE` (
  `SHIPMENT_COST_ESTIMATE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `SHIPMENT_METHOD_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `CARRIER_PARTY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `CARRIER_ROLE_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PRODUCT_STORE_SHIP_METH_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PRODUCT_STORE_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,
  `GEO_ID_TO` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `GEO_ID_FROM` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `WEIGHT_BREAK_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `WEIGHT_UOM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `WEIGHT_UNIT_PRICE` decimal(18,2) DEFAULT NULL,
  `QUANTITY_BREAK_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `QUANTITY_UOM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `QUANTITY_UNIT_PRICE` decimal(18,2) DEFAULT NULL,
  `PRICE_BREAK_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PRICE_UOM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PRICE_UNIT_PRICE` decimal(18,2) DEFAULT NULL,
  `ORDER_FLAT_PRICE` decimal(18,2) DEFAULT NULL,
  `ORDER_PRICE_PERCENT` decimal(18,6) DEFAULT NULL,
  `ORDER_ITEM_FLAT_PRICE` decimal(18,2) DEFAULT NULL,
  `SHIPPING_PRICE_PERCENT` decimal(18,6) DEFAULT NULL,
  `PRODUCT_FEATURE_GROUP_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `OVERSIZE_UNIT` decimal(18,6) DEFAULT NULL,
  `OVERSIZE_PRICE` decimal(18,2) DEFAULT NULL,
  `FEATURE_PERCENT` decimal(18,6) DEFAULT NULL,
  `FEATURE_PRICE` 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 (`SHIPMENT_COST_ESTIMATE_ID`),
  KEY `SHPMNT_CE_CSHMTH` (`SHIPMENT_METHOD_TYPE_ID`,`CARRIER_PARTY_ID`,`CARRIER_ROLE_TYPE_ID`),
  KEY `SHPMNT_PS_SH_METH` (`PRODUCT_STORE_SHIP_METH_ID`),
  KEY `SHPMNT_CE_PARTY` (`PARTY_ID`),
  KEY `SHPMNT_CE_ROLET` (`ROLE_TYPE_ID`),
  KEY `SHPMNT_CE_WUOM` (`WEIGHT_UOM_ID`),
  KEY `SHPMNT_CE_QUOM` (`QUANTITY_UOM_ID`),
  KEY `SHPMNT_CE_PUOM` (`PRICE_UOM_ID`),
  KEY `SHPMNT_CE_TGEO` (`GEO_ID_TO`),
  KEY `SHPMNT_CE_FGEO` (`GEO_ID_FROM`),
  KEY `SHPMNT_CE_WHT_QB` (`WEIGHT_BREAK_ID`),
  KEY `SHPMNT_CE_QNT_QB` (`QUANTITY_BREAK_ID`),
  KEY `SHPMNT_CE_PRC_QB` (`PRICE_BREAK_ID`),
  CONSTRAINT `SHPMNT_CE_CSHMTH` FOREIGN KEY (`SHIPMENT_METHOD_TYPE_ID`, `CARRIER_PARTY_ID`, `CARRIER_ROLE_TYPE_ID`) REFERENCES `CARRIER_SHIPMENT_METHOD` (`SHIPMENT_METHOD_TYPE_ID`, `PARTY_ID`, `ROLE_TYPE_ID`),
  CONSTRAINT `SHPMNT_CE_FGEO` FOREIGN KEY (`GEO_ID_FROM`) REFERENCES `GEO` (`GEO_ID`),
  CONSTRAINT `SHPMNT_CE_PARTY` FOREIGN KEY (`PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `SHPMNT_CE_PRC_QB` FOREIGN KEY (`PRICE_BREAK_ID`) REFERENCES `QUANTITY_BREAK` (`QUANTITY_BREAK_ID`),
  CONSTRAINT `SHPMNT_CE_PUOM` FOREIGN KEY (`PRICE_UOM_ID`) REFERENCES `UOM` (`UOM_ID`),
  CONSTRAINT `SHPMNT_CE_QNT_QB` FOREIGN KEY (`QUANTITY_BREAK_ID`) REFERENCES `QUANTITY_BREAK` (`QUANTITY_BREAK_ID`),
  CONSTRAINT `SHPMNT_CE_QUOM` FOREIGN KEY (`QUANTITY_UOM_ID`) REFERENCES `UOM` (`UOM_ID`),
  CONSTRAINT `SHPMNT_CE_ROLET` FOREIGN KEY (`ROLE_TYPE_ID`) REFERENCES `ROLE_TYPE` (`ROLE_TYPE_ID`),
  CONSTRAINT `SHPMNT_CE_TGEO` FOREIGN KEY (`GEO_ID_TO`) REFERENCES `GEO` (`GEO_ID`),
  CONSTRAINT `SHPMNT_CE_WHT_QB` FOREIGN KEY (`WEIGHT_BREAK_ID`) REFERENCES `QUANTITY_BREAK` (`QUANTITY_BREAK_ID`),
  CONSTRAINT `SHPMNT_CE_WUOM` FOREIGN KEY (`WEIGHT_UOM_ID`) REFERENCES `UOM` (`UOM_ID`),
  CONSTRAINT `SHPMNT_PS_SH_METH` FOREIGN KEY (`PRODUCT_STORE_SHIP_METH_ID`) REFERENCES `PRODUCT_STORE_SHIPMENT_METH` (`PRODUCT_STORE_SHIP_METH_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `SHIPMENT_GATEWAY_CONFIG`
--

DROP TABLE IF EXISTS `SHIPMENT_GATEWAY_CONFIG`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SHIPMENT_GATEWAY_CONFIG` (
  `SHIPMENT_GATEWAY_CONFIG_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `SHIPMENT_GATEWAY_CONF_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 (`SHIPMENT_GATEWAY_CONFIG_ID`),
  KEY `SGC_SGCT` (`SHIPMENT_GATEWAY_CONF_TYPE_ID`),
  CONSTRAINT `SGC_SGCT` FOREIGN KEY (`SHIPMENT_GATEWAY_CONF_TYPE_ID`) REFERENCES `SHIPMENT_GATEWAY_CONFIG_TYPE` (`SHIPMENT_GATEWAY_CONF_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `SHIPMENT_GATEWAY_CONFIG_TYPE`
--

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

--
-- Table structure for table `SHIPMENT_GATEWAY_DHL`
--

DROP TABLE IF EXISTS `SHIPMENT_GATEWAY_DHL`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SHIPMENT_GATEWAY_DHL` (
  `SHIPMENT_GATEWAY_CONFIG_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CONNECT_URL` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `CONNECT_TIMEOUT` decimal(20,0) DEFAULT NULL,
  `HEAD_VERSION` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `HEAD_ACTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `ACCESS_USER_ID` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `ACCESS_PASSWORD` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `ACCESS_ACCOUNT_NBR` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `ACCESS_SHIPPING_KEY` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LABEL_IMAGE_FORMAT` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `RATE_ESTIMATE_TEMPLATE` 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 (`SHIPMENT_GATEWAY_CONFIG_ID`),
  KEY `SGDHL_SGC` (`SHIPMENT_GATEWAY_CONFIG_ID`),
  CONSTRAINT `SGDHL_SGC` FOREIGN KEY (`SHIPMENT_GATEWAY_CONFIG_ID`) REFERENCES `SHIPMENT_GATEWAY_CONFIG` (`SHIPMENT_GATEWAY_CONFIG_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `SHIPMENT_GATEWAY_FEDEX`
--

DROP TABLE IF EXISTS `SHIPMENT_GATEWAY_FEDEX`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SHIPMENT_GATEWAY_FEDEX` (
  `SHIPMENT_GATEWAY_CONFIG_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CONNECT_URL` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `CONNECT_SOAP_URL` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `CONNECT_TIMEOUT` decimal(20,0) DEFAULT NULL,
  `ACCESS_ACCOUNT_NBR` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `ACCESS_METER_NUMBER` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `ACCESS_USER_KEY` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `ACCESS_USER_PWD` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LABEL_IMAGE_TYPE` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `DEFAULT_DROPOFF_TYPE` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `DEFAULT_PACKAGING_TYPE` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `TEMPLATE_SHIPMENT` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `TEMPLATE_SUBSCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `RATE_ESTIMATE_TEMPLATE` 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 (`SHIPMENT_GATEWAY_CONFIG_ID`),
  KEY `SGFED_SGC` (`SHIPMENT_GATEWAY_CONFIG_ID`),
  CONSTRAINT `SGFED_SGC` FOREIGN KEY (`SHIPMENT_GATEWAY_CONFIG_ID`) REFERENCES `SHIPMENT_GATEWAY_CONFIG` (`SHIPMENT_GATEWAY_CONFIG_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `SHIPMENT_GATEWAY_UPS`
--

DROP TABLE IF EXISTS `SHIPMENT_GATEWAY_UPS`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SHIPMENT_GATEWAY_UPS` (
  `SHIPMENT_GATEWAY_CONFIG_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CONNECT_URL` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `CONNECT_TIMEOUT` decimal(20,0) DEFAULT NULL,
  `SHIPPER_NUMBER` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `BILL_SHIPPER_ACCOUNT_NUMBER` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `ACCESS_LICENSE_NUMBER` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `ACCESS_USER_ID` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `ACCESS_PASSWORD` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `SAVE_CERT_INFO` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `SAVE_CERT_PATH` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `SHIPPER_PICKUP_TYPE` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `CUSTOMER_CLASSIFICATION` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `MAX_ESTIMATE_WEIGHT` decimal(18,6) DEFAULT NULL,
  `MIN_ESTIMATE_WEIGHT` decimal(18,6) DEFAULT NULL,
  `COD_ALLOW_COD` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `COD_SURCHARGE_AMOUNT` decimal(18,6) DEFAULT NULL,
  `COD_SURCHARGE_CURRENCY_UOM_ID` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `COD_SURCHARGE_APPLY_TO_PACKAGE` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `COD_FUNDS_CODE` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `DEFAULT_RETURN_LABEL_MEMO` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `DEFAULT_RETURN_LABEL_SUBJECT` 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 (`SHIPMENT_GATEWAY_CONFIG_ID`),
  KEY `SGUPS_SGC` (`SHIPMENT_GATEWAY_CONFIG_ID`),
  CONSTRAINT `SGUPS_SGC` FOREIGN KEY (`SHIPMENT_GATEWAY_CONFIG_ID`) REFERENCES `SHIPMENT_GATEWAY_CONFIG` (`SHIPMENT_GATEWAY_CONFIG_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `SHIPMENT_GATEWAY_USPS`
--

DROP TABLE IF EXISTS `SHIPMENT_GATEWAY_USPS`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SHIPMENT_GATEWAY_USPS` (
  `SHIPMENT_GATEWAY_CONFIG_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CONNECT_URL` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `CONNECT_URL_LABELS` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `CONNECT_TIMEOUT` decimal(20,0) DEFAULT NULL,
  `ACCESS_USER_ID` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `ACCESS_PASSWORD` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `MAX_ESTIMATE_WEIGHT` decimal(20,0) DEFAULT NULL,
  `TEST` 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_GATEWAY_CONFIG_ID`),
  KEY `SGUSPS_SGC` (`SHIPMENT_GATEWAY_CONFIG_ID`),
  CONSTRAINT `SGUSPS_SGC` FOREIGN KEY (`SHIPMENT_GATEWAY_CONFIG_ID`) REFERENCES `SHIPMENT_GATEWAY_CONFIG` (`SHIPMENT_GATEWAY_CONFIG_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `SHIPMENT_ITEM`
--

DROP TABLE IF EXISTS `SHIPMENT_ITEM`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SHIPMENT_ITEM` (
  `SHIPMENT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `SHIPMENT_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `QUANTITY` decimal(18,6) DEFAULT NULL,
  `SHIPMENT_CONTENT_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 (`SHIPMENT_ID`,`SHIPMENT_ITEM_SEQ_ID`),
  KEY `SHPMNT_ITM_SHPMT` (`SHIPMENT_ID`),
  KEY `SHPMNT_ITM_PROD` (`PRODUCT_ID`),
  CONSTRAINT `SHPMNT_ITM_PROD` FOREIGN KEY (`PRODUCT_ID`) REFERENCES `PRODUCT` (`PRODUCT_ID`),
  CONSTRAINT `SHPMNT_ITM_SHPMT` FOREIGN KEY (`SHIPMENT_ID`) REFERENCES `SHIPMENT` (`SHIPMENT_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `SHIPMENT_ITEM_BILLING`
--

DROP TABLE IF EXISTS `SHIPMENT_ITEM_BILLING`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SHIPMENT_ITEM_BILLING` (
  `SHIPMENT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `SHIPMENT_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `INVOICE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `INVOICE_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `LAST_UPDATED_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_ID`,`SHIPMENT_ITEM_SEQ_ID`,`INVOICE_ID`,`INVOICE_ITEM_SEQ_ID`),
  KEY `SHPMNT_ITBL_SPIM` (`SHIPMENT_ID`,`SHIPMENT_ITEM_SEQ_ID`),
  KEY `SHPMNT_ITBL_INIM` (`INVOICE_ID`,`INVOICE_ITEM_SEQ_ID`),
  CONSTRAINT `SHPMNT_ITBL_INIM` FOREIGN KEY (`INVOICE_ID`, `INVOICE_ITEM_SEQ_ID`) REFERENCES `INVOICE_ITEM` (`INVOICE_ID`, `INVOICE_ITEM_SEQ_ID`),
  CONSTRAINT `SHPMNT_ITBL_SPIM` FOREIGN KEY (`SHIPMENT_ID`, `SHIPMENT_ITEM_SEQ_ID`) REFERENCES `SHIPMENT_ITEM` (`SHIPMENT_ID`, `SHIPMENT_ITEM_SEQ_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `SHIPMENT_ITEM_FEATURE`
--

DROP TABLE IF EXISTS `SHIPMENT_ITEM_FEATURE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SHIPMENT_ITEM_FEATURE` (
  `SHIPMENT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `SHIPMENT_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_FEATURE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`SHIPMENT_ID`,`SHIPMENT_ITEM_SEQ_ID`,`PRODUCT_FEATURE_ID`),
  KEY `SHPMNT_ITFT_SPIM` (`SHIPMENT_ID`,`SHIPMENT_ITEM_SEQ_ID`),
  KEY `SHPMNT_ITFT_FEAT` (`PRODUCT_FEATURE_ID`),
  CONSTRAINT `SHPMNT_ITFT_FEAT` FOREIGN KEY (`PRODUCT_FEATURE_ID`) REFERENCES `PRODUCT_FEATURE` (`PRODUCT_FEATURE_ID`),
  CONSTRAINT `SHPMNT_ITFT_SPIM` FOREIGN KEY (`SHIPMENT_ID`, `SHIPMENT_ITEM_SEQ_ID`) REFERENCES `SHIPMENT_ITEM` (`SHIPMENT_ID`, `SHIPMENT_ITEM_SEQ_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `SHIPMENT_METHOD_TYPE`
--

DROP TABLE IF EXISTS `SHIPMENT_METHOD_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SHIPMENT_METHOD_TYPE` (
  `SHIPMENT_METHOD_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `SEQUENCE_NUM` decimal(20,0) DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`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 `SHIPMENT_PACKAGE`
--

DROP TABLE IF EXISTS `SHIPMENT_PACKAGE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SHIPMENT_PACKAGE` (
  `SHIPMENT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `SHIPMENT_PACKAGE_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `SHIPMENT_BOX_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `DATE_CREATED` datetime DEFAULT NULL,
  `BOX_LENGTH` decimal(18,6) DEFAULT NULL,
  `BOX_HEIGHT` decimal(18,6) DEFAULT NULL,
  `BOX_WIDTH` decimal(18,6) DEFAULT NULL,
  `DIMENSION_UOM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `WEIGHT` decimal(18,6) DEFAULT NULL,
  `WEIGHT_UOM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `INSURED_VALUE` 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 (`SHIPMENT_ID`,`SHIPMENT_PACKAGE_SEQ_ID`),
  KEY `SHPKG_SHPMNT` (`SHIPMENT_ID`),
  KEY `SHPKG_BXTYP` (`SHIPMENT_BOX_TYPE_ID`),
  KEY `SHPKG_DUOM` (`DIMENSION_UOM_ID`),
  KEY `SHPKG_WUOM` (`WEIGHT_UOM_ID`),
  CONSTRAINT `SHPKG_BXTYP` FOREIGN KEY (`SHIPMENT_BOX_TYPE_ID`) REFERENCES `SHIPMENT_BOX_TYPE` (`SHIPMENT_BOX_TYPE_ID`),
  CONSTRAINT `SHPKG_DUOM` FOREIGN KEY (`DIMENSION_UOM_ID`) REFERENCES `UOM` (`UOM_ID`),
  CONSTRAINT `SHPKG_SHPMNT` FOREIGN KEY (`SHIPMENT_ID`) REFERENCES `SHIPMENT` (`SHIPMENT_ID`),
  CONSTRAINT `SHPKG_WUOM` FOREIGN KEY (`WEIGHT_UOM_ID`) REFERENCES `UOM` (`UOM_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `SHIPMENT_PACKAGE_CONTENT`
--

DROP TABLE IF EXISTS `SHIPMENT_PACKAGE_CONTENT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SHIPMENT_PACKAGE_CONTENT` (
  `SHIPMENT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `SHIPMENT_PACKAGE_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `SHIPMENT_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `QUANTITY` decimal(18,6) DEFAULT NULL,
  `SUB_PRODUCT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SUB_PRODUCT_QUANTITY` decimal(18,6) DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`SHIPMENT_ID`,`SHIPMENT_PACKAGE_SEQ_ID`,`SHIPMENT_ITEM_SEQ_ID`),
  KEY `PCK_CNTNT_SHPKG` (`SHIPMENT_ID`,`SHIPMENT_PACKAGE_SEQ_ID`),
  KEY `PCK_CNTNT_SHITM` (`SHIPMENT_ID`,`SHIPMENT_ITEM_SEQ_ID`),
  KEY `PCK_CNTNT_PROD` (`SUB_PRODUCT_ID`),
  CONSTRAINT `PCK_CNTNT_PROD` FOREIGN KEY (`SUB_PRODUCT_ID`) REFERENCES `PRODUCT` (`PRODUCT_ID`),
  CONSTRAINT `PCK_CNTNT_SHITM` FOREIGN KEY (`SHIPMENT_ID`, `SHIPMENT_ITEM_SEQ_ID`) REFERENCES `SHIPMENT_ITEM` (`SHIPMENT_ID`, `SHIPMENT_ITEM_SEQ_ID`),
  CONSTRAINT `PCK_CNTNT_SHPKG` FOREIGN KEY (`SHIPMENT_ID`, `SHIPMENT_PACKAGE_SEQ_ID`) REFERENCES `SHIPMENT_PACKAGE` (`SHIPMENT_ID`, `SHIPMENT_PACKAGE_SEQ_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `SHIPMENT_PACKAGE_ROUTE_SEG`
--

DROP TABLE IF EXISTS `SHIPMENT_PACKAGE_ROUTE_SEG`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SHIPMENT_PACKAGE_ROUTE_SEG` (
  `SHIPMENT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `SHIPMENT_PACKAGE_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `SHIPMENT_ROUTE_SEGMENT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `TRACKING_CODE` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `BOX_NUMBER` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `LABEL_IMAGE` longblob,
  `LABEL_INTL_SIGN_IMAGE` longblob,
  `LABEL_HTML` longtext COLLATE latin1_general_cs,
  `LABEL_PRINTED` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `INTERNATIONAL_INVOICE` longblob,
  `PACKAGE_TRANSPORT_COST` decimal(18,2) DEFAULT NULL,
  `PACKAGE_SERVICE_COST` decimal(18,2) DEFAULT NULL,
  `PACKAGE_OTHER_COST` decimal(18,2) DEFAULT NULL,
  `COD_AMOUNT` decimal(18,2) DEFAULT NULL,
  `INSURED_AMOUNT` decimal(18,2) DEFAULT NULL,
  `CURRENCY_UOM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`SHIPMENT_ID`,`SHIPMENT_PACKAGE_SEQ_ID`,`SHIPMENT_ROUTE_SEGMENT_ID`),
  KEY `SHPKRTSG_SHPKG` (`SHIPMENT_ID`,`SHIPMENT_PACKAGE_SEQ_ID`),
  KEY `SHPKRTSG_RTSG` (`SHIPMENT_ID`,`SHIPMENT_ROUTE_SEGMENT_ID`),
  KEY `SHPKRTSG_CUOM` (`CURRENCY_UOM_ID`),
  CONSTRAINT `SHPKRTSG_CUOM` FOREIGN KEY (`CURRENCY_UOM_ID`) REFERENCES `UOM` (`UOM_ID`),
  CONSTRAINT `SHPKRTSG_RTSG` FOREIGN KEY (`SHIPMENT_ID`, `SHIPMENT_ROUTE_SEGMENT_ID`) REFERENCES `SHIPMENT_ROUTE_SEGMENT` (`SHIPMENT_ID`, `SHIPMENT_ROUTE_SEGMENT_ID`),
  CONSTRAINT `SHPKRTSG_SHPKG` FOREIGN KEY (`SHIPMENT_ID`, `SHIPMENT_PACKAGE_SEQ_ID`) REFERENCES `SHIPMENT_PACKAGE` (`SHIPMENT_ID`, `SHIPMENT_PACKAGE_SEQ_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `SHIPMENT_RECEIPT`
--

DROP TABLE IF EXISTS `SHIPMENT_RECEIPT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SHIPMENT_RECEIPT` (
  `RECEIPT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `INVENTORY_ITEM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PRODUCT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SHIPMENT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SHIPMENT_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SHIPMENT_PACKAGE_SEQ_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ORDER_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ORDER_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `RETURN_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `RETURN_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `REJECTION_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `RECEIVED_BY_USER_LOGIN_ID` varchar(250) COLLATE latin1_general_cs DEFAULT NULL,
  `DATETIME_RECEIVED` datetime DEFAULT NULL,
  `ITEM_DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `QUANTITY_ACCEPTED` decimal(18,6) DEFAULT NULL,
  `QUANTITY_REJECTED` 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 (`RECEIPT_ID`),
  KEY `SHP_RCPT_INVITM` (`INVENTORY_ITEM_ID`),
  KEY `SHP_RCPT_PROD` (`PRODUCT_ID`),
  KEY `SHP_RCPT_SHPKG` (`SHIPMENT_ID`,`SHIPMENT_PACKAGE_SEQ_ID`),
  KEY `SHP_RCPT_ORDITM` (`ORDER_ID`,`ORDER_ITEM_SEQ_ID`),
  KEY `SHP_RCPT_REJRSN` (`REJECTION_ID`),
  KEY `SHP_RCPT_USERLGN` (`RECEIVED_BY_USER_LOGIN_ID`),
  KEY `SHP_RCPT_RETINVITM` (`RETURN_ID`,`RETURN_ITEM_SEQ_ID`),
  CONSTRAINT `SHP_RCPT_INVITM` FOREIGN KEY (`INVENTORY_ITEM_ID`) REFERENCES `INVENTORY_ITEM` (`INVENTORY_ITEM_ID`),
  CONSTRAINT `SHP_RCPT_ORDITM` FOREIGN KEY (`ORDER_ID`, `ORDER_ITEM_SEQ_ID`) REFERENCES `ORDER_ITEM` (`ORDER_ID`, `ORDER_ITEM_SEQ_ID`),
  CONSTRAINT `SHP_RCPT_PROD` FOREIGN KEY (`PRODUCT_ID`) REFERENCES `PRODUCT` (`PRODUCT_ID`),
  CONSTRAINT `SHP_RCPT_REJRSN` FOREIGN KEY (`REJECTION_ID`) REFERENCES `REJECTION_REASON` (`REJECTION_ID`),
  CONSTRAINT `SHP_RCPT_RETINVITM` FOREIGN KEY (`RETURN_ID`, `RETURN_ITEM_SEQ_ID`) REFERENCES `RETURN_ITEM` (`RETURN_ID`, `RETURN_ITEM_SEQ_ID`),
  CONSTRAINT `SHP_RCPT_SHPKG` FOREIGN KEY (`SHIPMENT_ID`, `SHIPMENT_PACKAGE_SEQ_ID`) REFERENCES `SHIPMENT_PACKAGE` (`SHIPMENT_ID`, `SHIPMENT_PACKAGE_SEQ_ID`),
  CONSTRAINT `SHP_RCPT_USERLGN` FOREIGN KEY (`RECEIVED_BY_USER_LOGIN_ID`) REFERENCES `USER_LOGIN` (`USER_LOGIN_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `SHIPMENT_RECEIPT_ROLE`
--

DROP TABLE IF EXISTS `SHIPMENT_RECEIPT_ROLE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SHIPMENT_RECEIPT_ROLE` (
  `RECEIPT_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 (`RECEIPT_ID`,`PARTY_ID`,`ROLE_TYPE_ID`),
  KEY `SHP_RCPTRL_RCPT` (`RECEIPT_ID`),
  KEY `SHP_RCPTRL_PTY` (`PARTY_ID`),
  KEY `SHP_RCPTRL_PTRL` (`PARTY_ID`,`ROLE_TYPE_ID`),
  CONSTRAINT `SHP_RCPTRL_PTRL` FOREIGN KEY (`PARTY_ID`, `ROLE_TYPE_ID`) REFERENCES `PARTY_ROLE` (`PARTY_ID`, `ROLE_TYPE_ID`),
  CONSTRAINT `SHP_RCPTRL_PTY` FOREIGN KEY (`PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `SHP_RCPTRL_RCPT` FOREIGN KEY (`RECEIPT_ID`) REFERENCES `SHIPMENT_RECEIPT` (`RECEIPT_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `SHIPMENT_ROUTE_SEGMENT`
--

DROP TABLE IF EXISTS `SHIPMENT_ROUTE_SEGMENT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SHIPMENT_ROUTE_SEGMENT` (
  `SHIPMENT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `SHIPMENT_ROUTE_SEGMENT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `DELIVERY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ORIGIN_FACILITY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `DEST_FACILITY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ORIGIN_CONTACT_MECH_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ORIGIN_TELECOM_NUMBER_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `DEST_CONTACT_MECH_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `DEST_TELECOM_NUMBER_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `CARRIER_PARTY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SHIPMENT_METHOD_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `CARRIER_SERVICE_STATUS_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `CARRIER_DELIVERY_ZONE` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `CARRIER_RESTRICTION_CODES` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `CARRIER_RESTRICTION_DESC` longtext COLLATE latin1_general_cs,
  `BILLING_WEIGHT` decimal(18,6) DEFAULT NULL,
  `BILLING_WEIGHT_UOM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ACTUAL_TRANSPORT_COST` decimal(18,2) DEFAULT NULL,
  `ACTUAL_SERVICE_COST` decimal(18,2) DEFAULT NULL,
  `ACTUAL_OTHER_COST` decimal(18,2) DEFAULT NULL,
  `ACTUAL_COST` decimal(18,2) DEFAULT NULL,
  `CURRENCY_UOM_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,
  `TRACKING_ID_NUMBER` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `TRACKING_DIGEST` longtext COLLATE latin1_general_cs,
  `UPDATED_BY_USER_LOGIN_ID` varchar(250) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_DATE` datetime DEFAULT NULL,
  `HOME_DELIVERY_TYPE` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `HOME_DELIVERY_DATE` datetime DEFAULT NULL,
  `THIRD_PARTY_ACCOUNT_NUMBER` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `THIRD_PARTY_POSTAL_CODE` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `THIRD_PARTY_COUNTRY_GEO_CODE` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `UPS_HIGH_VALUE_REPORT` 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 (`SHIPMENT_ID`,`SHIPMENT_ROUTE_SEGMENT_ID`),
  KEY `SHPMT_RTSEG_SHPMT` (`SHIPMENT_ID`),
  KEY `SHPMT_RTSEG_DEL` (`DELIVERY_ID`),
  KEY `SHPMT_RTSEG_CPTY` (`CARRIER_PARTY_ID`),
  KEY `SHPMT_RTSEG_SHMT` (`SHIPMENT_METHOD_TYPE_ID`),
  KEY `SHPMT_RTSEG_OFAC` (`ORIGIN_FACILITY_ID`),
  KEY `SHPMT_RTSEG_DFAC` (`DEST_FACILITY_ID`),
  KEY `SHPMT_RTSEG_OPAD` (`ORIGIN_CONTACT_MECH_ID`),
  KEY `SHPMT_RTSEG_OTCN` (`ORIGIN_TELECOM_NUMBER_ID`),
  KEY `SHPMT_RTSEG_DPAD` (`DEST_CONTACT_MECH_ID`),
  KEY `SHPMT_RTSEG_DTCN` (`DEST_TELECOM_NUMBER_ID`),
  KEY `SHPKRTSG_CSSTS` (`CARRIER_SERVICE_STATUS_ID`),
  KEY `SHPMT_RTSEG_CUOM` (`CURRENCY_UOM_ID`),
  KEY `SHPKRTSG_BWUOM` (`BILLING_WEIGHT_UOM_ID`),
  CONSTRAINT `SHPKRTSG_BWUOM` FOREIGN KEY (`BILLING_WEIGHT_UOM_ID`) REFERENCES `UOM` (`UOM_ID`),
  CONSTRAINT `SHPKRTSG_CSSTS` FOREIGN KEY (`CARRIER_SERVICE_STATUS_ID`) REFERENCES `STATUS_ITEM` (`STATUS_ID`),
  CONSTRAINT `SHPMT_RTSEG_CPTY` FOREIGN KEY (`CARRIER_PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `SHPMT_RTSEG_CUOM` FOREIGN KEY (`CURRENCY_UOM_ID`) REFERENCES `UOM` (`UOM_ID`),
  CONSTRAINT `SHPMT_RTSEG_DEL` FOREIGN KEY (`DELIVERY_ID`) REFERENCES `DELIVERY` (`DELIVERY_ID`),
  CONSTRAINT `SHPMT_RTSEG_DFAC` FOREIGN KEY (`DEST_FACILITY_ID`) REFERENCES `FACILITY` (`FACILITY_ID`),
  CONSTRAINT `SHPMT_RTSEG_DPAD` FOREIGN KEY (`DEST_CONTACT_MECH_ID`) REFERENCES `POSTAL_ADDRESS` (`CONTACT_MECH_ID`),
  CONSTRAINT `SHPMT_RTSEG_DTCN` FOREIGN KEY (`DEST_TELECOM_NUMBER_ID`) REFERENCES `TELECOM_NUMBER` (`CONTACT_MECH_ID`),
  CONSTRAINT `SHPMT_RTSEG_OFAC` FOREIGN KEY (`ORIGIN_FACILITY_ID`) REFERENCES `FACILITY` (`FACILITY_ID`),
  CONSTRAINT `SHPMT_RTSEG_OPAD` FOREIGN KEY (`ORIGIN_CONTACT_MECH_ID`) REFERENCES `POSTAL_ADDRESS` (`CONTACT_MECH_ID`),
  CONSTRAINT `SHPMT_RTSEG_OTCN` FOREIGN KEY (`ORIGIN_TELECOM_NUMBER_ID`) REFERENCES `TELECOM_NUMBER` (`CONTACT_MECH_ID`),
  CONSTRAINT `SHPMT_RTSEG_SHMT` FOREIGN KEY (`SHIPMENT_METHOD_TYPE_ID`) REFERENCES `SHIPMENT_METHOD_TYPE` (`SHIPMENT_METHOD_TYPE_ID`),
  CONSTRAINT `SHPMT_RTSEG_SHPMT` FOREIGN KEY (`SHIPMENT_ID`) REFERENCES `SHIPMENT` (`SHIPMENT_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `SHIPMENT_STATUS`
--

DROP TABLE IF EXISTS `SHIPMENT_STATUS`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SHIPMENT_STATUS` (
  `STATUS_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `SHIPMENT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `STATUS_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 (`STATUS_ID`,`SHIPMENT_ID`),
  KEY `SHPMNT_STTS_STTS` (`STATUS_ID`),
  KEY `SHPMNT_STTS_SHMT` (`SHIPMENT_ID`),
  CONSTRAINT `SHPMNT_STTS_SHMT` FOREIGN KEY (`SHIPMENT_ID`) REFERENCES `SHIPMENT` (`SHIPMENT_ID`),
  CONSTRAINT `SHPMNT_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 `SHIPMENT_TYPE`
--

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

--
-- Table structure for table `SHIPMENT_TYPE_ATTR`
--

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

--
-- Table structure for table `SHIPPING_DOCUMENT`
--

DROP TABLE IF EXISTS `SHIPPING_DOCUMENT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SHIPPING_DOCUMENT` (
  `DOCUMENT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `SHIPMENT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SHIPMENT_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SHIPMENT_PACKAGE_SEQ_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 (`DOCUMENT_ID`),
  KEY `SHPNG_DOC_DOC` (`DOCUMENT_ID`),
  KEY `SHPNG_DOC_SMITM` (`SHIPMENT_ID`,`SHIPMENT_ITEM_SEQ_ID`),
  KEY `SHPNG_DOC_SHPKG` (`SHIPMENT_ID`,`SHIPMENT_PACKAGE_SEQ_ID`),
  CONSTRAINT `SHPNG_DOC_DOC` FOREIGN KEY (`DOCUMENT_ID`) REFERENCES `DOCUMENT` (`DOCUMENT_ID`),
  CONSTRAINT `SHPNG_DOC_SHPKG` FOREIGN KEY (`SHIPMENT_ID`, `SHIPMENT_PACKAGE_SEQ_ID`) REFERENCES `SHIPMENT_PACKAGE` (`SHIPMENT_ID`, `SHIPMENT_PACKAGE_SEQ_ID`),
  CONSTRAINT `SHPNG_DOC_SMITM` FOREIGN KEY (`SHIPMENT_ID`, `SHIPMENT_ITEM_SEQ_ID`) REFERENCES `SHIPMENT_ITEM` (`SHIPMENT_ID`, `SHIPMENT_ITEM_SEQ_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `SHOPPING_LIST`
--

DROP TABLE IF EXISTS `SHOPPING_LIST`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SHOPPING_LIST` (
  `SHOPPING_LIST_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `SHOPPING_LIST_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PARENT_SHOPPING_LIST_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PRODUCT_STORE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `VISITOR_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `LIST_NAME` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `IS_PUBLIC` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `IS_ACTIVE` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `CURRENCY_UOM` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SHIPMENT_METHOD_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `CARRIER_PARTY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `CARRIER_ROLE_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `CONTACT_MECH_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PAYMENT_METHOD_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `RECURRENCE_INFO_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_ORDERED_DATE` datetime DEFAULT NULL,
  `LAST_ADMIN_MODIFIED` datetime DEFAULT NULL,
  `PRODUCT_PROMO_CODE_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 (`SHOPPING_LIST_ID`),
  KEY `SHLIST_PARENT` (`PARENT_SHOPPING_LIST_ID`),
  KEY `SHLIST_TYPE` (`SHOPPING_LIST_TYPE_ID`),
  KEY `SHLIST_PRDS` (`PRODUCT_STORE_ID`),
  KEY `SHLIST_PTY` (`PARTY_ID`),
  KEY `SHLIST_VSTR` (`VISITOR_ID`),
  KEY `SHLIST_CSSM` (`SHIPMENT_METHOD_TYPE_ID`,`CARRIER_PARTY_ID`,`CARRIER_ROLE_TYPE_ID`),
  KEY `SHLIST_CMECH` (`CONTACT_MECH_ID`),
  KEY `SHLIST_PYMETH` (`PAYMENT_METHOD_ID`),
  KEY `SHLIST_RECINFO` (`RECURRENCE_INFO_ID`),
  KEY `SHLIST_PRMCD` (`PRODUCT_PROMO_CODE_ID`),
  CONSTRAINT `SHLIST_CMECH` FOREIGN KEY (`CONTACT_MECH_ID`) REFERENCES `CONTACT_MECH` (`CONTACT_MECH_ID`),
  CONSTRAINT `SHLIST_CSSM` FOREIGN KEY (`SHIPMENT_METHOD_TYPE_ID`, `CARRIER_PARTY_ID`, `CARRIER_ROLE_TYPE_ID`) REFERENCES `CARRIER_SHIPMENT_METHOD` (`SHIPMENT_METHOD_TYPE_ID`, `PARTY_ID`, `ROLE_TYPE_ID`),
  CONSTRAINT `SHLIST_PARENT` FOREIGN KEY (`PARENT_SHOPPING_LIST_ID`) REFERENCES `SHOPPING_LIST` (`SHOPPING_LIST_ID`),
  CONSTRAINT `SHLIST_PRDS` FOREIGN KEY (`PRODUCT_STORE_ID`) REFERENCES `PRODUCT_STORE` (`PRODUCT_STORE_ID`),
  CONSTRAINT `SHLIST_PRMCD` FOREIGN KEY (`PRODUCT_PROMO_CODE_ID`) REFERENCES `PRODUCT_PROMO_CODE` (`PRODUCT_PROMO_CODE_ID`),
  CONSTRAINT `SHLIST_PTY` FOREIGN KEY (`PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `SHLIST_PYMETH` FOREIGN KEY (`PAYMENT_METHOD_ID`) REFERENCES `PAYMENT_METHOD` (`PAYMENT_METHOD_ID`),
  CONSTRAINT `SHLIST_RECINFO` FOREIGN KEY (`RECURRENCE_INFO_ID`) REFERENCES `RECURRENCE_INFO` (`RECURRENCE_INFO_ID`),
  CONSTRAINT `SHLIST_TYPE` FOREIGN KEY (`SHOPPING_LIST_TYPE_ID`) REFERENCES `SHOPPING_LIST_TYPE` (`SHOPPING_LIST_TYPE_ID`),
  CONSTRAINT `SHLIST_VSTR` FOREIGN KEY (`VISITOR_ID`) REFERENCES `VISITOR` (`VISITOR_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `SHOPPING_LIST_ITEM`
--

DROP TABLE IF EXISTS `SHOPPING_LIST_ITEM`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SHOPPING_LIST_ITEM` (
  `SHOPPING_LIST_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `SHOPPING_LIST_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `QUANTITY` decimal(18,6) DEFAULT NULL,
  `MODIFIED_PRICE` decimal(18,3) DEFAULT NULL,
  `RESERV_START` datetime DEFAULT NULL,
  `RESERV_LENGTH` decimal(18,6) DEFAULT NULL,
  `RESERV_PERSONS` decimal(18,6) DEFAULT NULL,
  `QUANTITY_PURCHASED` decimal(18,6) DEFAULT NULL,
  `CONFIG_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 (`SHOPPING_LIST_ID`,`SHOPPING_LIST_ITEM_SEQ_ID`),
  KEY `SHLIST_ITEM_LIST` (`SHOPPING_LIST_ID`),
  KEY `SHLIST_ITEM_PROD` (`PRODUCT_ID`),
  CONSTRAINT `SHLIST_ITEM_LIST` FOREIGN KEY (`SHOPPING_LIST_ID`) REFERENCES `SHOPPING_LIST` (`SHOPPING_LIST_ID`),
  CONSTRAINT `SHLIST_ITEM_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 `SHOPPING_LIST_ITEM_SURVEY`
--

DROP TABLE IF EXISTS `SHOPPING_LIST_ITEM_SURVEY`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SHOPPING_LIST_ITEM_SURVEY` (
  `SHOPPING_LIST_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `SHOPPING_LIST_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `SURVEY_RESPONSE_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 (`SHOPPING_LIST_ID`,`SHOPPING_LIST_ITEM_SEQ_ID`,`SURVEY_RESPONSE_ID`),
  KEY `SHLIST_ITSUR_LIST` (`SHOPPING_LIST_ID`),
  KEY `SHLIST_ITSUR_ITEM` (`SHOPPING_LIST_ID`,`SHOPPING_LIST_ITEM_SEQ_ID`),
  KEY `SHLIST_ITSUR_RESP` (`SURVEY_RESPONSE_ID`),
  CONSTRAINT `SHLIST_ITSUR_ITEM` FOREIGN KEY (`SHOPPING_LIST_ID`, `SHOPPING_LIST_ITEM_SEQ_ID`) REFERENCES `SHOPPING_LIST_ITEM` (`SHOPPING_LIST_ID`, `SHOPPING_LIST_ITEM_SEQ_ID`),
  CONSTRAINT `SHLIST_ITSUR_LIST` FOREIGN KEY (`SHOPPING_LIST_ID`) REFERENCES `SHOPPING_LIST` (`SHOPPING_LIST_ID`),
  CONSTRAINT `SHLIST_ITSUR_RESP` FOREIGN KEY (`SURVEY_RESPONSE_ID`) REFERENCES `SURVEY_RESPONSE` (`SURVEY_RESPONSE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `SHOPPING_LIST_TYPE`
--

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

--
-- Table structure for table `SHOPPING_LIST_WORK_EFFORT`
--

DROP TABLE IF EXISTS `SHOPPING_LIST_WORK_EFFORT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SHOPPING_LIST_WORK_EFFORT` (
  `SHOPPING_LIST_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 (`SHOPPING_LIST_ID`,`WORK_EFFORT_ID`),
  KEY `SHLISTWE_SHLST` (`SHOPPING_LIST_ID`),
  KEY `SHLISTWE_WEFF` (`WORK_EFFORT_ID`),
  CONSTRAINT `SHLISTWE_SHLST` FOREIGN KEY (`SHOPPING_LIST_ID`) REFERENCES `SHOPPING_LIST` (`SHOPPING_LIST_ID`),
  CONSTRAINT `SHLISTWE_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 `SKILL_TYPE`
--

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

--
-- Table structure for table `STANDARD_LANGUAGE`
--

DROP TABLE IF EXISTS `STANDARD_LANGUAGE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `STANDARD_LANGUAGE` (
  `STANDARD_LANGUAGE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `LANG_CODE3T` varchar(10) COLLATE latin1_general_cs DEFAULT NULL,
  `LANG_CODE3B` varchar(10) COLLATE latin1_general_cs DEFAULT NULL,
  `LANG_CODE2` varchar(10) COLLATE latin1_general_cs DEFAULT NULL,
  `LANG_NAME` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `LANG_FAMILY` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `LANG_CHARSET` 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 (`STANDARD_LANGUAGE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `STANDARD_TIME_PERIOD`
--

DROP TABLE IF EXISTS `STANDARD_TIME_PERIOD`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `STANDARD_TIME_PERIOD` (
  `STANDARD_TIME_PERIOD_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PERIOD_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `FROM_DATE` datetime DEFAULT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`STANDARD_TIME_PERIOD_ID`),
  KEY `STD_TM_PER_TYPE` (`PERIOD_TYPE_ID`),
  CONSTRAINT `STD_TM_PER_TYPE` 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 `STATUS_ITEM`
--

DROP TABLE IF EXISTS `STATUS_ITEM`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `STATUS_ITEM` (
  `STATUS_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `STATUS_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `STATUS_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 (`STATUS_ID`),
  KEY `STATUS_TO_TYPE` (`STATUS_TYPE_ID`),
  CONSTRAINT `STATUS_TO_TYPE` FOREIGN KEY (`STATUS_TYPE_ID`) REFERENCES `STATUS_TYPE` (`STATUS_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `STATUS_TYPE`
--

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

--
-- Table structure for table `STATUS_VALID_CHANGE`
--

DROP TABLE IF EXISTS `STATUS_VALID_CHANGE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `STATUS_VALID_CHANGE` (
  `STATUS_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `STATUS_ID_TO` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CONDITION_EXPRESSION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `TRANSITION_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 (`STATUS_ID`,`STATUS_ID_TO`),
  KEY `STATUS_CHG_MAIN` (`STATUS_ID`),
  KEY `STATUS_CHG_TO` (`STATUS_ID_TO`),
  CONSTRAINT `STATUS_CHG_MAIN` FOREIGN KEY (`STATUS_ID`) REFERENCES `STATUS_ITEM` (`STATUS_ID`),
  CONSTRAINT `STATUS_CHG_TO` FOREIGN KEY (`STATUS_ID_TO`) REFERENCES `STATUS_ITEM` (`STATUS_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `SUBSCRIPTION`
--

DROP TABLE IF EXISTS `SUBSCRIPTION`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SUBSCRIPTION` (
  `SUBSCRIPTION_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `SUBSCRIPTION_RESOURCE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `COMMUNICATION_EVENT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `CONTACT_MECH_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ORIGINATED_FROM_PARTY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ORIGINATED_FROM_ROLE_TYPE_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,
  `PARTY_NEED_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `NEED_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ORDER_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ORDER_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PRODUCT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PRODUCT_CATEGORY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `INVENTORY_ITEM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SUBSCRIPTION_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `EXTERNAL_SUBSCRIPTION_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `FROM_DATE` datetime DEFAULT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `PURCHASE_FROM_DATE` datetime DEFAULT NULL,
  `PURCHASE_THRU_DATE` datetime DEFAULT NULL,
  `MAX_LIFE_TIME` decimal(20,0) DEFAULT NULL,
  `MAX_LIFE_TIME_UOM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `AVAILABLE_TIME` decimal(20,0) DEFAULT NULL,
  `AVAILABLE_TIME_UOM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `USE_COUNT_LIMIT` decimal(20,0) DEFAULT NULL,
  `USE_TIME` decimal(20,0) DEFAULT NULL,
  `USE_TIME_UOM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `AUTOMATIC_EXTEND` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `CANCL_AUTM_EXT_TIME` decimal(20,0) DEFAULT NULL,
  `CANCL_AUTM_EXT_TIME_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 (`SUBSCRIPTION_ID`),
  KEY `SUBSC_SRESRC` (`SUBSCRIPTION_RESOURCE_ID`),
  KEY `SUBSC_CONT_MECH` (`CONTACT_MECH_ID`),
  KEY `SUBSC_PARTY` (`PARTY_ID`),
  KEY `SUBSC_UTU` (`USE_TIME_UOM_ID`),
  KEY `SUBSC_CTU` (`CANCL_AUTM_EXT_TIME_UOM_ID`),
  KEY `SUBSC_ATU` (`AVAILABLE_TIME_UOM_ID`),
  KEY `SUBSC_MTU` (`MAX_LIFE_TIME_UOM_ID`),
  KEY `SUBSC_ROLE_TYPE` (`ROLE_TYPE_ID`),
  KEY `SUBSC_OPARTY` (`ORIGINATED_FROM_PARTY_ID`),
  KEY `SUBSC_OROLE_TYPE` (`ORIGINATED_FROM_ROLE_TYPE_ID`),
  KEY `SUBSC_NEED_TYPE` (`NEED_TYPE_ID`),
  KEY `SUBSC_ORDERITM` (`ORDER_ID`,`ORDER_ITEM_SEQ_ID`),
  KEY `SUBSC_PRODUCT` (`PRODUCT_ID`),
  KEY `SUBSC_PROD_CAT` (`PRODUCT_CATEGORY_ID`),
  KEY `SUBSC_INV_ITM` (`INVENTORY_ITEM_ID`),
  KEY `SUBSC_TO_TYPE` (`SUBSCRIPTION_TYPE_ID`),
  CONSTRAINT `SUBSC_ATU` FOREIGN KEY (`AVAILABLE_TIME_UOM_ID`) REFERENCES `UOM` (`UOM_ID`),
  CONSTRAINT `SUBSC_CONT_MECH` FOREIGN KEY (`CONTACT_MECH_ID`) REFERENCES `CONTACT_MECH` (`CONTACT_MECH_ID`),
  CONSTRAINT `SUBSC_CTU` FOREIGN KEY (`CANCL_AUTM_EXT_TIME_UOM_ID`) REFERENCES `UOM` (`UOM_ID`),
  CONSTRAINT `SUBSC_INV_ITM` FOREIGN KEY (`INVENTORY_ITEM_ID`) REFERENCES `INVENTORY_ITEM` (`INVENTORY_ITEM_ID`),
  CONSTRAINT `SUBSC_MTU` FOREIGN KEY (`MAX_LIFE_TIME_UOM_ID`) REFERENCES `UOM` (`UOM_ID`),
  CONSTRAINT `SUBSC_NEED_TYPE` FOREIGN KEY (`NEED_TYPE_ID`) REFERENCES `NEED_TYPE` (`NEED_TYPE_ID`),
  CONSTRAINT `SUBSC_OPARTY` FOREIGN KEY (`ORIGINATED_FROM_PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `SUBSC_ORDERITM` FOREIGN KEY (`ORDER_ID`, `ORDER_ITEM_SEQ_ID`) REFERENCES `ORDER_ITEM` (`ORDER_ID`, `ORDER_ITEM_SEQ_ID`),
  CONSTRAINT `SUBSC_OROLE_TYPE` FOREIGN KEY (`ORIGINATED_FROM_ROLE_TYPE_ID`) REFERENCES `ROLE_TYPE` (`ROLE_TYPE_ID`),
  CONSTRAINT `SUBSC_PARTY` FOREIGN KEY (`PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `SUBSC_PRODUCT` FOREIGN KEY (`PRODUCT_ID`) REFERENCES `PRODUCT` (`PRODUCT_ID`),
  CONSTRAINT `SUBSC_PROD_CAT` FOREIGN KEY (`PRODUCT_CATEGORY_ID`) REFERENCES `PRODUCT_CATEGORY` (`PRODUCT_CATEGORY_ID`),
  CONSTRAINT `SUBSC_ROLE_TYPE` FOREIGN KEY (`ROLE_TYPE_ID`) REFERENCES `ROLE_TYPE` (`ROLE_TYPE_ID`),
  CONSTRAINT `SUBSC_SRESRC` FOREIGN KEY (`SUBSCRIPTION_RESOURCE_ID`) REFERENCES `SUBSCRIPTION_RESOURCE` (`SUBSCRIPTION_RESOURCE_ID`),
  CONSTRAINT `SUBSC_TO_TYPE` FOREIGN KEY (`SUBSCRIPTION_TYPE_ID`) REFERENCES `SUBSCRIPTION_TYPE` (`SUBSCRIPTION_TYPE_ID`),
  CONSTRAINT `SUBSC_UTU` FOREIGN KEY (`USE_TIME_UOM_ID`) REFERENCES `UOM` (`UOM_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `SUBSCRIPTION_ACTIVITY`
--

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

--
-- Table structure for table `SUBSCRIPTION_ATTRIBUTE`
--

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

--
-- Table structure for table `SUBSCRIPTION_COMM_EVENT`
--

DROP TABLE IF EXISTS `SUBSCRIPTION_COMM_EVENT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SUBSCRIPTION_COMM_EVENT` (
  `SUBSCRIPTION_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 (`SUBSCRIPTION_ID`,`COMMUNICATION_EVENT_ID`),
  KEY `SUBSC_COM_EVENT` (`COMMUNICATION_EVENT_ID`),
  KEY `SUBSC_SUBSC` (`SUBSCRIPTION_ID`),
  CONSTRAINT `SUBSC_COM_EVENT` FOREIGN KEY (`COMMUNICATION_EVENT_ID`) REFERENCES `COMMUNICATION_EVENT` (`COMMUNICATION_EVENT_ID`),
  CONSTRAINT `SUBSC_SUBSC` FOREIGN KEY (`SUBSCRIPTION_ID`) REFERENCES `SUBSCRIPTION` (`SUBSCRIPTION_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `SUBSCRIPTION_FULFILLMENT_PIECE`
--

DROP TABLE IF EXISTS `SUBSCRIPTION_FULFILLMENT_PIECE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SUBSCRIPTION_FULFILLMENT_PIECE` (
  `SUBSCRIPTION_ACTIVITY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `SUBSCRIPTION_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 (`SUBSCRIPTION_ACTIVITY_ID`,`SUBSCRIPTION_ID`),
  KEY `SUBSC_FP` (`SUBSCRIPTION_ID`),
  KEY `SUBSC_FP_ACT` (`SUBSCRIPTION_ACTIVITY_ID`),
  CONSTRAINT `SUBSC_FP` FOREIGN KEY (`SUBSCRIPTION_ID`) REFERENCES `SUBSCRIPTION` (`SUBSCRIPTION_ID`),
  CONSTRAINT `SUBSC_FP_ACT` FOREIGN KEY (`SUBSCRIPTION_ACTIVITY_ID`) REFERENCES `SUBSCRIPTION_ACTIVITY` (`SUBSCRIPTION_ACTIVITY_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `SUBSCRIPTION_RESOURCE`
--

DROP TABLE IF EXISTS `SUBSCRIPTION_RESOURCE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SUBSCRIPTION_RESOURCE` (
  `SUBSCRIPTION_RESOURCE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARENT_RESOURCE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `CONTENT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `WEB_SITE_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 (`SUBSCRIPTION_RESOURCE_ID`),
  KEY `SUBSC_RES_PARENT` (`PARENT_RESOURCE_ID`),
  KEY `SUBSC_RES_CNTNT` (`CONTENT_ID`),
  KEY `SUBSC_RES_WBSITE` (`WEB_SITE_ID`),
  CONSTRAINT `SUBSC_RES_CNTNT` FOREIGN KEY (`CONTENT_ID`) REFERENCES `CONTENT` (`CONTENT_ID`),
  CONSTRAINT `SUBSC_RES_PARENT` FOREIGN KEY (`PARENT_RESOURCE_ID`) REFERENCES `SUBSCRIPTION_RESOURCE` (`SUBSCRIPTION_RESOURCE_ID`),
  CONSTRAINT `SUBSC_RES_WBSITE` FOREIGN KEY (`WEB_SITE_ID`) REFERENCES `WEB_SITE` (`WEB_SITE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `SUBSCRIPTION_TYPE`
--

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

--
-- Table structure for table `SUBSCRIPTION_TYPE_ATTR`
--

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

--
-- Table structure for table `SUPPLIER_PREF_ORDER`
--

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

--
-- Table structure for table `SUPPLIER_PRODUCT`
--

DROP TABLE IF EXISTS `SUPPLIER_PRODUCT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SUPPLIER_PRODUCT` (
  `PRODUCT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `AVAILABLE_FROM_DATE` datetime NOT NULL,
  `AVAILABLE_THRU_DATE` datetime DEFAULT NULL,
  `SUPPLIER_PREF_ORDER_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SUPPLIER_RATING_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `STANDARD_LEAD_TIME_DAYS` decimal(18,6) DEFAULT NULL,
  `MINIMUM_ORDER_QUANTITY` decimal(18,6) NOT NULL,
  `ORDER_QTY_INCREMENTS` decimal(18,6) DEFAULT NULL,
  `UNITS_INCLUDED` decimal(18,6) DEFAULT NULL,
  `QUANTITY_UOM_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,
  `LAST_PRICE` decimal(18,3) DEFAULT NULL,
  `SHIPPING_PRICE` decimal(18,3) DEFAULT NULL,
  `CURRENCY_UOM_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `SUPPLIER_PRODUCT_NAME` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `SUPPLIER_PRODUCT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `CAN_DROP_SHIP` char(1) 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 (`PRODUCT_ID`,`PARTY_ID`,`CURRENCY_UOM_ID`,`MINIMUM_ORDER_QUANTITY`,`AVAILABLE_FROM_DATE`),
  KEY `SUPPL_PROD_PROD` (`PRODUCT_ID`),
  KEY `SUPPL_PROD_PARTY` (`PARTY_ID`),
  KEY `SUPPL_PROD_SPORD` (`SUPPLIER_PREF_ORDER_ID`),
  KEY `SUPPL_PROD_SRTPE` (`SUPPLIER_RATING_TYPE_ID`),
  KEY `SUPPL_PROD_CUOM` (`CURRENCY_UOM_ID`),
  KEY `SUPPL_PROD_QUOM` (`QUANTITY_UOM_ID`),
  KEY `SUPPL_PROD_AGRIT` (`AGREEMENT_ID`,`AGREEMENT_ITEM_SEQ_ID`),
  CONSTRAINT `SUPPL_PROD_AGRIT` FOREIGN KEY (`AGREEMENT_ID`, `AGREEMENT_ITEM_SEQ_ID`) REFERENCES `AGREEMENT_ITEM` (`AGREEMENT_ID`, `AGREEMENT_ITEM_SEQ_ID`),
  CONSTRAINT `SUPPL_PROD_CUOM` FOREIGN KEY (`CURRENCY_UOM_ID`) REFERENCES `UOM` (`UOM_ID`),
  CONSTRAINT `SUPPL_PROD_PARTY` FOREIGN KEY (`PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `SUPPL_PROD_PROD` FOREIGN KEY (`PRODUCT_ID`) REFERENCES `PRODUCT` (`PRODUCT_ID`),
  CONSTRAINT `SUPPL_PROD_QUOM` FOREIGN KEY (`QUANTITY_UOM_ID`) REFERENCES `UOM` (`UOM_ID`),
  CONSTRAINT `SUPPL_PROD_SPORD` FOREIGN KEY (`SUPPLIER_PREF_ORDER_ID`) REFERENCES `SUPPLIER_PREF_ORDER` (`SUPPLIER_PREF_ORDER_ID`),
  CONSTRAINT `SUPPL_PROD_SRTPE` FOREIGN KEY (`SUPPLIER_RATING_TYPE_ID`) REFERENCES `SUPPLIER_RATING_TYPE` (`SUPPLIER_RATING_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `SUPPLIER_PRODUCT_FEATURE`
--

DROP TABLE IF EXISTS `SUPPLIER_PRODUCT_FEATURE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SUPPLIER_PRODUCT_FEATURE` (
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_FEATURE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `DESCRIPTION` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `UOM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ID_CODE` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`PARTY_ID`,`PRODUCT_FEATURE_ID`),
  KEY `SUPPL_FEAT_PARTY` (`PARTY_ID`),
  KEY `SUPPL_FEAT_FEAT` (`PRODUCT_FEATURE_ID`),
  KEY `SUPPL_FEAT_UOM` (`UOM_ID`),
  CONSTRAINT `SUPPL_FEAT_FEAT` FOREIGN KEY (`PRODUCT_FEATURE_ID`) REFERENCES `PRODUCT_FEATURE` (`PRODUCT_FEATURE_ID`),
  CONSTRAINT `SUPPL_FEAT_PARTY` FOREIGN KEY (`PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `SUPPL_FEAT_UOM` FOREIGN KEY (`UOM_ID`) REFERENCES `UOM` (`UOM_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `SUPPLIER_RATING_TYPE`
--

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

--
-- Table structure for table `SURVEY`
--

DROP TABLE IF EXISTS `SURVEY`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SURVEY` (
  `SURVEY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `SURVEY_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,
  `SUBMIT_CAPTION` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `RESPONSE_SERVICE` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `IS_ANONYMOUS` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `ALLOW_MULTIPLE` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `ALLOW_UPDATE` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `ACRO_FORM_CONTENT_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 (`SURVEY_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `SURVEY_APPL_TYPE`
--

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

--
-- Table structure for table `SURVEY_MULTI_RESP`
--

DROP TABLE IF EXISTS `SURVEY_MULTI_RESP`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SURVEY_MULTI_RESP` (
  `SURVEY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `SURVEY_MULTI_RESP_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `MULTI_RESP_TITLE` 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 (`SURVEY_ID`,`SURVEY_MULTI_RESP_ID`),
  KEY `SRVYMRSP_SRVY` (`SURVEY_ID`),
  CONSTRAINT `SRVYMRSP_SRVY` FOREIGN KEY (`SURVEY_ID`) REFERENCES `SURVEY` (`SURVEY_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `SURVEY_MULTI_RESP_COLUMN`
--

DROP TABLE IF EXISTS `SURVEY_MULTI_RESP_COLUMN`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SURVEY_MULTI_RESP_COLUMN` (
  `SURVEY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `SURVEY_MULTI_RESP_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `SURVEY_MULTI_RESP_COL_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `COLUMN_TITLE` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `SEQUENCE_NUM` decimal(20,0) DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`SURVEY_ID`,`SURVEY_MULTI_RESP_ID`,`SURVEY_MULTI_RESP_COL_ID`),
  KEY `SRVYMRSPCL_SMRESP` (`SURVEY_ID`,`SURVEY_MULTI_RESP_ID`),
  CONSTRAINT `SRVYMRSPCL_SMRESP` FOREIGN KEY (`SURVEY_ID`, `SURVEY_MULTI_RESP_ID`) REFERENCES `SURVEY_MULTI_RESP` (`SURVEY_ID`, `SURVEY_MULTI_RESP_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `SURVEY_PAGE`
--

DROP TABLE IF EXISTS `SURVEY_PAGE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SURVEY_PAGE` (
  `SURVEY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `SURVEY_PAGE_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PAGE_NAME` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `SEQUENCE_NUM` decimal(20,0) DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`SURVEY_ID`,`SURVEY_PAGE_SEQ_ID`),
  KEY `SRVYPAGE_SRVY` (`SURVEY_ID`),
  CONSTRAINT `SRVYPAGE_SRVY` FOREIGN KEY (`SURVEY_ID`) REFERENCES `SURVEY` (`SURVEY_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `SURVEY_QUESTION`
--

DROP TABLE IF EXISTS `SURVEY_QUESTION`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SURVEY_QUESTION` (
  `SURVEY_QUESTION_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `SURVEY_QUESTION_CATEGORY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SURVEY_QUESTION_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `QUESTION` longtext COLLATE latin1_general_cs,
  `HINT` longtext COLLATE latin1_general_cs,
  `ENUM_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `GEO_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `FORMAT_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 (`SURVEY_QUESTION_ID`),
  KEY `SRVYQST_SRVYQTP` (`SURVEY_QUESTION_TYPE_ID`),
  KEY `SRVYQST_SRVYQTCT` (`SURVEY_QUESTION_CATEGORY_ID`),
  KEY `SRVYQST_GEO` (`GEO_ID`),
  CONSTRAINT `SRVYQST_GEO` FOREIGN KEY (`GEO_ID`) REFERENCES `GEO` (`GEO_ID`),
  CONSTRAINT `SRVYQST_SRVYQTCT` FOREIGN KEY (`SURVEY_QUESTION_CATEGORY_ID`) REFERENCES `SURVEY_QUESTION_CATEGORY` (`SURVEY_QUESTION_CATEGORY_ID`),
  CONSTRAINT `SRVYQST_SRVYQTP` FOREIGN KEY (`SURVEY_QUESTION_TYPE_ID`) REFERENCES `SURVEY_QUESTION_TYPE` (`SURVEY_QUESTION_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `SURVEY_QUESTION_APPL`
--

DROP TABLE IF EXISTS `SURVEY_QUESTION_APPL`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SURVEY_QUESTION_APPL` (
  `SURVEY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `SURVEY_QUESTION_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FROM_DATE` datetime NOT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `SURVEY_PAGE_SEQ_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SURVEY_MULTI_RESP_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SURVEY_MULTI_RESP_COL_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `REQUIRED_FIELD` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `SEQUENCE_NUM` decimal(20,0) DEFAULT NULL,
  `EXTERNAL_FIELD_REF` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `WITH_SURVEY_QUESTION_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `WITH_SURVEY_OPTION_SEQ_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`SURVEY_ID`,`SURVEY_QUESTION_ID`,`FROM_DATE`),
  KEY `SRVYQSTAPL_SRVY` (`SURVEY_ID`),
  KEY `SRVYQSTAPL_SRVYQ` (`SURVEY_QUESTION_ID`),
  KEY `SRVYQSTAPL_SVQO` (`WITH_SURVEY_QUESTION_ID`,`WITH_SURVEY_OPTION_SEQ_ID`),
  CONSTRAINT `SRVYQSTAPL_SRVY` FOREIGN KEY (`SURVEY_ID`) REFERENCES `SURVEY` (`SURVEY_ID`),
  CONSTRAINT `SRVYQSTAPL_SRVYQ` FOREIGN KEY (`SURVEY_QUESTION_ID`) REFERENCES `SURVEY_QUESTION` (`SURVEY_QUESTION_ID`),
  CONSTRAINT `SRVYQSTAPL_SVQO` FOREIGN KEY (`WITH_SURVEY_QUESTION_ID`, `WITH_SURVEY_OPTION_SEQ_ID`) REFERENCES `SURVEY_QUESTION_OPTION` (`SURVEY_QUESTION_ID`, `SURVEY_OPTION_SEQ_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `SURVEY_QUESTION_CATEGORY`
--

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

--
-- Table structure for table `SURVEY_QUESTION_OPTION`
--

DROP TABLE IF EXISTS `SURVEY_QUESTION_OPTION`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SURVEY_QUESTION_OPTION` (
  `SURVEY_QUESTION_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `SURVEY_OPTION_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `SEQUENCE_NUM` decimal(20,0) DEFAULT NULL,
  `AMOUNT_BASE` decimal(18,2) DEFAULT NULL,
  `AMOUNT_BASE_UOM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `WEIGHT_FACTOR` double DEFAULT NULL,
  `DURATION` decimal(20,0) DEFAULT NULL,
  `DURATION_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 (`SURVEY_QUESTION_ID`,`SURVEY_OPTION_SEQ_ID`),
  KEY `SRVYQSTOP_SRVYQ` (`SURVEY_QUESTION_ID`),
  CONSTRAINT `SRVYQSTOP_SRVYQ` FOREIGN KEY (`SURVEY_QUESTION_ID`) REFERENCES `SURVEY_QUESTION` (`SURVEY_QUESTION_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `SURVEY_QUESTION_TYPE`
--

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

--
-- Table structure for table `SURVEY_RESPONSE`
--

DROP TABLE IF EXISTS `SURVEY_RESPONSE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SURVEY_RESPONSE` (
  `SURVEY_RESPONSE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `SURVEY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `RESPONSE_DATE` datetime DEFAULT NULL,
  `LAST_MODIFIED_DATE` datetime DEFAULT NULL,
  `REFERENCE_ID` varchar(250) COLLATE latin1_general_cs DEFAULT NULL,
  `GENERAL_FEEDBACK` longtext COLLATE latin1_general_cs,
  `ORDER_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ORDER_ITEM_SEQ_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 (`SURVEY_RESPONSE_ID`),
  KEY `SRVYRSP_SRVY` (`SURVEY_ID`),
  KEY `SRVYRSP_STTS` (`STATUS_ID`),
  CONSTRAINT `SRVYRSP_SRVY` FOREIGN KEY (`SURVEY_ID`) REFERENCES `SURVEY` (`SURVEY_ID`),
  CONSTRAINT `SRVYRSP_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 `SURVEY_RESPONSE_ANSWER`
--

DROP TABLE IF EXISTS `SURVEY_RESPONSE_ANSWER`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SURVEY_RESPONSE_ANSWER` (
  `SURVEY_RESPONSE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `SURVEY_QUESTION_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `SURVEY_MULTI_RESP_COL_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `SURVEY_MULTI_RESP_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `BOOLEAN_RESPONSE` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `CURRENCY_RESPONSE` decimal(18,2) DEFAULT NULL,
  `FLOAT_RESPONSE` double DEFAULT NULL,
  `NUMERIC_RESPONSE` decimal(20,0) DEFAULT NULL,
  `TEXT_RESPONSE` longtext COLLATE latin1_general_cs,
  `SURVEY_OPTION_SEQ_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `CONTENT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ANSWERED_DATE` datetime DEFAULT NULL,
  `AMOUNT_BASE` decimal(18,2) DEFAULT NULL,
  `AMOUNT_BASE_UOM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `WEIGHT_FACTOR` double DEFAULT NULL,
  `DURATION` decimal(20,0) DEFAULT NULL,
  `DURATION_UOM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SEQUENCE_NUM` decimal(20,0) DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`SURVEY_RESPONSE_ID`,`SURVEY_QUESTION_ID`,`SURVEY_MULTI_RESP_COL_ID`),
  KEY `SRVYRSPA_SVRSP` (`SURVEY_RESPONSE_ID`),
  KEY `SRVYRSPA_SVQU` (`SURVEY_QUESTION_ID`),
  KEY `SRVYRSPA_OPT` (`SURVEY_QUESTION_ID`,`SURVEY_OPTION_SEQ_ID`),
  KEY `SRVYRSPA_CONT` (`CONTENT_ID`),
  CONSTRAINT `SRVYRSPA_CONT` FOREIGN KEY (`CONTENT_ID`) REFERENCES `CONTENT` (`CONTENT_ID`),
  CONSTRAINT `SRVYRSPA_OPT` FOREIGN KEY (`SURVEY_QUESTION_ID`, `SURVEY_OPTION_SEQ_ID`) REFERENCES `SURVEY_QUESTION_OPTION` (`SURVEY_QUESTION_ID`, `SURVEY_OPTION_SEQ_ID`),
  CONSTRAINT `SRVYRSPA_SVQU` FOREIGN KEY (`SURVEY_QUESTION_ID`) REFERENCES `SURVEY_QUESTION` (`SURVEY_QUESTION_ID`),
  CONSTRAINT `SRVYRSPA_SVRSP` FOREIGN KEY (`SURVEY_RESPONSE_ID`) REFERENCES `SURVEY_RESPONSE` (`SURVEY_RESPONSE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `SURVEY_TRIGGER`
--

DROP TABLE IF EXISTS `SURVEY_TRIGGER`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SURVEY_TRIGGER` (
  `SURVEY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `SURVEY_APPL_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 (`SURVEY_ID`,`SURVEY_APPL_TYPE_ID`,`FROM_DATE`),
  KEY `SRVYTRG_SRVY` (`SURVEY_ID`),
  KEY `SRVYTRG_SRVYAPT` (`SURVEY_APPL_TYPE_ID`),
  CONSTRAINT `SRVYTRG_SRVY` FOREIGN KEY (`SURVEY_ID`) REFERENCES `SURVEY` (`SURVEY_ID`),
  CONSTRAINT `SRVYTRG_SRVYAPT` FOREIGN KEY (`SURVEY_APPL_TYPE_ID`) REFERENCES `SURVEY_APPL_TYPE` (`SURVEY_APPL_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `SYSTEM_PROPERTY`
--

DROP TABLE IF EXISTS `SYSTEM_PROPERTY`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SYSTEM_PROPERTY` (
  `SYSTEM_RESOURCE_ID` varchar(60) COLLATE latin1_general_cs NOT NULL,
  `SYSTEM_PROPERTY_ID` varchar(60) COLLATE latin1_general_cs NOT NULL,
  `SYSTEM_PROPERTY_VALUE` 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 (`SYSTEM_RESOURCE_ID`,`SYSTEM_PROPERTY_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `TARPITTED_LOGIN_VIEW`
--

DROP TABLE IF EXISTS `TARPITTED_LOGIN_VIEW`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `TARPITTED_LOGIN_VIEW` (
  `VIEW_NAME_ID` varchar(60) COLLATE latin1_general_cs NOT NULL,
  `USER_LOGIN_ID` varchar(250) COLLATE latin1_general_cs NOT NULL,
  `TARPIT_RELEASE_DATE_TIME` decimal(20,0) DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`VIEW_NAME_ID`,`USER_LOGIN_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `TAX_AUTHORITY`
--

DROP TABLE IF EXISTS `TAX_AUTHORITY`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `TAX_AUTHORITY` (
  `TAX_AUTH_GEO_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `TAX_AUTH_PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `REQUIRE_TAX_ID_FOR_EXEMPTION` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `TAX_ID_FORMAT_PATTERN` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `INCLUDE_TAX_IN_PRICE` 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 (`TAX_AUTH_GEO_ID`,`TAX_AUTH_PARTY_ID`),
  KEY `TAXAUTH_TAGEO` (`TAX_AUTH_GEO_ID`),
  KEY `TAXAUTH_TAPARTY` (`TAX_AUTH_PARTY_ID`),
  CONSTRAINT `TAXAUTH_TAGEO` FOREIGN KEY (`TAX_AUTH_GEO_ID`) REFERENCES `GEO` (`GEO_ID`),
  CONSTRAINT `TAXAUTH_TAPARTY` FOREIGN KEY (`TAX_AUTH_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 `TAX_AUTHORITY_ASSOC`
--

DROP TABLE IF EXISTS `TAX_AUTHORITY_ASSOC`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `TAX_AUTHORITY_ASSOC` (
  `TAX_AUTH_GEO_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `TAX_AUTH_PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `TO_TAX_AUTH_GEO_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `TO_TAX_AUTH_PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FROM_DATE` datetime NOT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `TAX_AUTHORITY_ASSOC_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`TAX_AUTH_GEO_ID`,`TAX_AUTH_PARTY_ID`,`TO_TAX_AUTH_GEO_ID`,`TO_TAX_AUTH_PARTY_ID`,`FROM_DATE`),
  KEY `TAXAUTHASC_TXA` (`TAX_AUTH_GEO_ID`,`TAX_AUTH_PARTY_ID`),
  KEY `TAXAUTHASC_TOTXA` (`TO_TAX_AUTH_GEO_ID`,`TO_TAX_AUTH_PARTY_ID`),
  KEY `TAXAUTHASC_ASTP` (`TAX_AUTHORITY_ASSOC_TYPE_ID`),
  CONSTRAINT `TAXAUTHASC_ASTP` FOREIGN KEY (`TAX_AUTHORITY_ASSOC_TYPE_ID`) REFERENCES `TAX_AUTHORITY_ASSOC_TYPE` (`TAX_AUTHORITY_ASSOC_TYPE_ID`),
  CONSTRAINT `TAXAUTHASC_TOTXA` FOREIGN KEY (`TO_TAX_AUTH_GEO_ID`, `TO_TAX_AUTH_PARTY_ID`) REFERENCES `TAX_AUTHORITY` (`TAX_AUTH_GEO_ID`, `TAX_AUTH_PARTY_ID`),
  CONSTRAINT `TAXAUTHASC_TXA` FOREIGN KEY (`TAX_AUTH_GEO_ID`, `TAX_AUTH_PARTY_ID`) REFERENCES `TAX_AUTHORITY` (`TAX_AUTH_GEO_ID`, `TAX_AUTH_PARTY_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `TAX_AUTHORITY_ASSOC_TYPE`
--

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

--
-- Table structure for table `TAX_AUTHORITY_CATEGORY`
--

DROP TABLE IF EXISTS `TAX_AUTHORITY_CATEGORY`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `TAX_AUTHORITY_CATEGORY` (
  `TAX_AUTH_GEO_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `TAX_AUTH_PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_CATEGORY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`TAX_AUTH_GEO_ID`,`TAX_AUTH_PARTY_ID`,`PRODUCT_CATEGORY_ID`),
  KEY `TAXAUTHCAT_TXA` (`TAX_AUTH_GEO_ID`,`TAX_AUTH_PARTY_ID`),
  KEY `TAXAUTHCAT_CAT` (`PRODUCT_CATEGORY_ID`),
  CONSTRAINT `TAXAUTHCAT_CAT` FOREIGN KEY (`PRODUCT_CATEGORY_ID`) REFERENCES `PRODUCT_CATEGORY` (`PRODUCT_CATEGORY_ID`),
  CONSTRAINT `TAXAUTHCAT_TXA` FOREIGN KEY (`TAX_AUTH_GEO_ID`, `TAX_AUTH_PARTY_ID`) REFERENCES `TAX_AUTHORITY` (`TAX_AUTH_GEO_ID`, `TAX_AUTH_PARTY_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `TAX_AUTHORITY_GL_ACCOUNT`
--

DROP TABLE IF EXISTS `TAX_AUTHORITY_GL_ACCOUNT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `TAX_AUTHORITY_GL_ACCOUNT` (
  `TAX_AUTH_GEO_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `TAX_AUTH_PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ORGANIZATION_PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `GL_ACCOUNT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`TAX_AUTH_GEO_ID`,`TAX_AUTH_PARTY_ID`,`ORGANIZATION_PARTY_ID`),
  KEY `TAXAUTHGLA_TXA` (`TAX_AUTH_GEO_ID`,`TAX_AUTH_PARTY_ID`),
  KEY `TAXAUTHGLA_OPTY` (`ORGANIZATION_PARTY_ID`),
  KEY `TAXAUTHGLA_GLA` (`GL_ACCOUNT_ID`),
  CONSTRAINT `TAXAUTHGLA_GLA` FOREIGN KEY (`GL_ACCOUNT_ID`) REFERENCES `GL_ACCOUNT` (`GL_ACCOUNT_ID`),
  CONSTRAINT `TAXAUTHGLA_OPTY` FOREIGN KEY (`ORGANIZATION_PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `TAXAUTHGLA_TXA` FOREIGN KEY (`TAX_AUTH_GEO_ID`, `TAX_AUTH_PARTY_ID`) REFERENCES `TAX_AUTHORITY` (`TAX_AUTH_GEO_ID`, `TAX_AUTH_PARTY_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `TAX_AUTHORITY_RATE_PRODUCT`
--

DROP TABLE IF EXISTS `TAX_AUTHORITY_RATE_PRODUCT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `TAX_AUTHORITY_RATE_PRODUCT` (
  `TAX_AUTHORITY_RATE_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `TAX_AUTH_GEO_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `TAX_AUTH_PARTY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `TAX_AUTHORITY_RATE_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PRODUCT_STORE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PRODUCT_CATEGORY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `TITLE_TRANSFER_ENUM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `MIN_ITEM_PRICE` decimal(18,2) DEFAULT NULL,
  `MIN_PURCHASE` decimal(18,2) DEFAULT NULL,
  `TAX_SHIPPING` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `TAX_PERCENTAGE` decimal(18,6) DEFAULT NULL,
  `TAX_PROMOTIONS` char(1) 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,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`TAX_AUTHORITY_RATE_SEQ_ID`),
  KEY `TAXAUTHRTEP_TXA` (`TAX_AUTH_GEO_ID`,`TAX_AUTH_PARTY_ID`),
  KEY `TAXAUTHRTEP_RTTP` (`TAX_AUTHORITY_RATE_TYPE_ID`),
  KEY `TAXAUTHRTEP_PSTR` (`PRODUCT_STORE_ID`),
  KEY `TAXAUTHRTEP_PCAT` (`PRODUCT_CATEGORY_ID`),
  CONSTRAINT `TAXAUTHRTEP_PCAT` FOREIGN KEY (`PRODUCT_CATEGORY_ID`) REFERENCES `PRODUCT_CATEGORY` (`PRODUCT_CATEGORY_ID`),
  CONSTRAINT `TAXAUTHRTEP_PSTR` FOREIGN KEY (`PRODUCT_STORE_ID`) REFERENCES `PRODUCT_STORE` (`PRODUCT_STORE_ID`),
  CONSTRAINT `TAXAUTHRTEP_RTTP` FOREIGN KEY (`TAX_AUTHORITY_RATE_TYPE_ID`) REFERENCES `TAX_AUTHORITY_RATE_TYPE` (`TAX_AUTHORITY_RATE_TYPE_ID`),
  CONSTRAINT `TAXAUTHRTEP_TXA` FOREIGN KEY (`TAX_AUTH_GEO_ID`, `TAX_AUTH_PARTY_ID`) REFERENCES `TAX_AUTHORITY` (`TAX_AUTH_GEO_ID`, `TAX_AUTH_PARTY_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `TAX_AUTHORITY_RATE_TYPE`
--

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

--
-- Table structure for table `TECH_DATA_CALENDAR`
--

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

--
-- Table structure for table `TECH_DATA_CALENDAR_EXC_DAY`
--

DROP TABLE IF EXISTS `TECH_DATA_CALENDAR_EXC_DAY`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `TECH_DATA_CALENDAR_EXC_DAY` (
  `CALENDAR_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `EXCEPTION_DATE_START_TIME` datetime NOT NULL,
  `EXCEPTION_CAPACITY` decimal(18,6) DEFAULT NULL,
  `USED_CAPACITY` decimal(18,6) 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 (`CALENDAR_ID`,`EXCEPTION_DATE_START_TIME`),
  KEY `EXC_DAY_CALENDAR` (`CALENDAR_ID`),
  CONSTRAINT `EXC_DAY_CALENDAR` FOREIGN KEY (`CALENDAR_ID`) REFERENCES `TECH_DATA_CALENDAR` (`CALENDAR_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `TECH_DATA_CALENDAR_EXC_WEEK`
--

DROP TABLE IF EXISTS `TECH_DATA_CALENDAR_EXC_WEEK`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `TECH_DATA_CALENDAR_EXC_WEEK` (
  `CALENDAR_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `EXCEPTION_DATE_START` date NOT NULL,
  `CALENDAR_WEEK_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 (`CALENDAR_ID`,`EXCEPTION_DATE_START`),
  KEY `EXC_WEEK_CALENDAR` (`CALENDAR_ID`),
  KEY `EXC_WEEK_WEEK` (`CALENDAR_WEEK_ID`),
  CONSTRAINT `EXC_WEEK_CALENDAR` FOREIGN KEY (`CALENDAR_ID`) REFERENCES `TECH_DATA_CALENDAR` (`CALENDAR_ID`),
  CONSTRAINT `EXC_WEEK_WEEK` FOREIGN KEY (`CALENDAR_WEEK_ID`) REFERENCES `TECH_DATA_CALENDAR_WEEK` (`CALENDAR_WEEK_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `TECH_DATA_CALENDAR_WEEK`
--

DROP TABLE IF EXISTS `TECH_DATA_CALENDAR_WEEK`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `TECH_DATA_CALENDAR_WEEK` (
  `CALENDAR_WEEK_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `MONDAY_START_TIME` time DEFAULT NULL,
  `MONDAY_CAPACITY` double DEFAULT NULL,
  `TUESDAY_START_TIME` time DEFAULT NULL,
  `TUESDAY_CAPACITY` double DEFAULT NULL,
  `WEDNESDAY_START_TIME` time DEFAULT NULL,
  `WEDNESDAY_CAPACITY` double DEFAULT NULL,
  `THURSDAY_START_TIME` time DEFAULT NULL,
  `THURSDAY_CAPACITY` double DEFAULT NULL,
  `FRIDAY_START_TIME` time DEFAULT NULL,
  `FRIDAY_CAPACITY` double DEFAULT NULL,
  `SATURDAY_START_TIME` time DEFAULT NULL,
  `SATURDAY_CAPACITY` double DEFAULT NULL,
  `SUNDAY_START_TIME` time DEFAULT NULL,
  `SUNDAY_CAPACITY` 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 (`CALENDAR_WEEK_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `TELECOM_NUMBER`
--

DROP TABLE IF EXISTS `TELECOM_NUMBER`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `TELECOM_NUMBER` (
  `CONTACT_MECH_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `COUNTRY_CODE` varchar(10) COLLATE latin1_general_cs DEFAULT NULL,
  `AREA_CODE` varchar(10) COLLATE latin1_general_cs DEFAULT NULL,
  `CONTACT_NUMBER` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `ASK_FOR_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 (`CONTACT_MECH_ID`),
  KEY `TEL_NUM_CMECH` (`CONTACT_MECH_ID`),
  CONSTRAINT `TEL_NUM_CMECH` 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 `TEMPORAL_EXPRESSION`
--

DROP TABLE IF EXISTS `TEMPORAL_EXPRESSION`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `TEMPORAL_EXPRESSION` (
  `TEMP_EXPR_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `TEMP_EXPR_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `DATE1` datetime DEFAULT NULL,
  `DATE2` datetime DEFAULT NULL,
  `INTEGER1` decimal(20,0) DEFAULT NULL,
  `INTEGER2` decimal(20,0) DEFAULT NULL,
  `STRING1` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `STRING2` 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 (`TEMP_EXPR_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `TEMPORAL_EXPRESSION_ASSOC`
--

DROP TABLE IF EXISTS `TEMPORAL_EXPRESSION_ASSOC`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `TEMPORAL_EXPRESSION_ASSOC` (
  `FROM_TEMP_EXPR_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `TO_TEMP_EXPR_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `EXPR_ASSOC_TYPE` 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 (`FROM_TEMP_EXPR_ID`,`TO_TEMP_EXPR_ID`),
  KEY `TEMP_EXPR_FROM` (`FROM_TEMP_EXPR_ID`),
  KEY `TEMP_EXPR_TO` (`TO_TEMP_EXPR_ID`),
  CONSTRAINT `TEMP_EXPR_FROM` FOREIGN KEY (`FROM_TEMP_EXPR_ID`) REFERENCES `TEMPORAL_EXPRESSION` (`TEMP_EXPR_ID`),
  CONSTRAINT `TEMP_EXPR_TO` FOREIGN KEY (`TO_TEMP_EXPR_ID`) REFERENCES `TEMPORAL_EXPRESSION` (`TEMP_EXPR_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `TENANT_KEY_ENCRYPTING_KEY`
--

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

--
-- Table structure for table `TERMINATION_REASON`
--

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

--
-- Table structure for table `TERMINATION_TYPE`
--

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

--
-- Table structure for table `TERM_TYPE`
--

DROP TABLE IF EXISTS `TERM_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `TERM_TYPE` (
  `TERM_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 (`TERM_TYPE_ID`),
  KEY `TERM_TYPE_PAR` (`PARENT_TYPE_ID`),
  CONSTRAINT `TERM_TYPE_PAR` FOREIGN KEY (`PARENT_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 `TERM_TYPE_ATTR`
--

DROP TABLE IF EXISTS `TERM_TYPE_ATTR`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `TERM_TYPE_ATTR` (
  `TERM_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 (`TERM_TYPE_ID`,`ATTR_NAME`),
  KEY `TERM_TYPATR_TTYP` (`TERM_TYPE_ID`),
  CONSTRAINT `TERM_TYPATR_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 `TESTING`
--

DROP TABLE IF EXISTS `TESTING`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `TESTING` (
  `TESTING_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `TESTING_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `TESTING_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,
  `TESTING_SIZE` decimal(20,0) DEFAULT NULL,
  `TESTING_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 (`TESTING_ID`),
  KEY `ENTITY_ENTY_TYP` (`TESTING_TYPE_ID`),
  CONSTRAINT `ENTITY_ENTY_TYP` FOREIGN KEY (`TESTING_TYPE_ID`) REFERENCES `TESTING_TYPE` (`TESTING_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `TESTING_NODE`
--

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

--
-- Table structure for table `TESTING_NODE_MEMBER`
--

DROP TABLE IF EXISTS `TESTING_NODE_MEMBER`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `TESTING_NODE_MEMBER` (
  `TESTING_NODE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `TESTING_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 (`TESTING_NODE_ID`,`TESTING_ID`,`FROM_DATE`),
  KEY `TESTING_NMBR_TEST` (`TESTING_ID`),
  KEY `TEST_NMBR_NODE` (`TESTING_NODE_ID`),
  CONSTRAINT `TESTING_NMBR_TEST` FOREIGN KEY (`TESTING_ID`) REFERENCES `TESTING` (`TESTING_ID`),
  CONSTRAINT `TEST_NMBR_NODE` FOREIGN KEY (`TESTING_NODE_ID`) REFERENCES `TESTING_NODE` (`TESTING_NODE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `TESTING_REMOVE_ALL`
--

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

--
-- Table structure for table `TESTING_SUBTYPE`
--

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

--
-- Table structure for table `TESTING_TYPE`
--

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

--
-- Table structure for table `TEST_BLOB`
--

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

--
-- Table structure for table `TEST_FIELD_TYPE`
--

DROP TABLE IF EXISTS `TEST_FIELD_TYPE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `TEST_FIELD_TYPE` (
  `TEST_FIELD_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `BLOB_FIELD` longblob,
  `BYTE_ARRAY_FIELD` longblob,
  `OBJECT_FIELD` longblob,
  `DATE_FIELD` date DEFAULT NULL,
  `TIME_FIELD` time DEFAULT NULL,
  `DATE_TIME_FIELD` datetime DEFAULT NULL,
  `FIXED_POINT_FIELD` decimal(18,6) DEFAULT NULL,
  `FLOATING_POINT_FIELD` double DEFAULT NULL,
  `NUMERIC_FIELD` decimal(20,0) DEFAULT NULL,
  `CLOB_FIELD` 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 (`TEST_FIELD_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `TIMESHEET`
--

DROP TABLE IF EXISTS `TIMESHEET`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `TIMESHEET` (
  `TIMESHEET_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `CLIENT_PARTY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `FROM_DATE` datetime DEFAULT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `STATUS_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `APPROVED_BY_USER_LOGIN_ID` varchar(250) 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 (`TIMESHEET_ID`),
  KEY `TIMESHEET_PRTY` (`PARTY_ID`),
  KEY `TIMESHEET_CPTY` (`CLIENT_PARTY_ID`),
  KEY `TIMESHEET_STS` (`STATUS_ID`),
  KEY `TIMESHEET_AB_UL` (`APPROVED_BY_USER_LOGIN_ID`),
  CONSTRAINT `TIMESHEET_AB_UL` FOREIGN KEY (`APPROVED_BY_USER_LOGIN_ID`) REFERENCES `USER_LOGIN` (`USER_LOGIN_ID`),
  CONSTRAINT `TIMESHEET_CPTY` FOREIGN KEY (`CLIENT_PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `TIMESHEET_PRTY` FOREIGN KEY (`PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `TIMESHEET_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 `TIMESHEET_ROLE`
--

DROP TABLE IF EXISTS `TIMESHEET_ROLE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `TIMESHEET_ROLE` (
  `TIMESHEET_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 (`TIMESHEET_ID`,`PARTY_ID`,`ROLE_TYPE_ID`),
  KEY `TIMESHTRL_TSHT` (`TIMESHEET_ID`),
  KEY `TIMESHTRL_PRTY` (`PARTY_ID`),
  KEY `TIMESHTRL_PTRL` (`PARTY_ID`,`ROLE_TYPE_ID`),
  CONSTRAINT `TIMESHTRL_PRTY` FOREIGN KEY (`PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `TIMESHTRL_PTRL` FOREIGN KEY (`PARTY_ID`, `ROLE_TYPE_ID`) REFERENCES `PARTY_ROLE` (`PARTY_ID`, `ROLE_TYPE_ID`),
  CONSTRAINT `TIMESHTRL_TSHT` FOREIGN KEY (`TIMESHEET_ID`) REFERENCES `TIMESHEET` (`TIMESHEET_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `TIME_ENTRY`
--

DROP TABLE IF EXISTS `TIME_ENTRY`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `TIME_ENTRY` (
  `TIME_ENTRY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `FROM_DATE` datetime DEFAULT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `RATE_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `WORK_EFFORT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `TIMESHEET_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `INVOICE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `INVOICE_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `HOURS` double 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 (`TIME_ENTRY_ID`),
  KEY `TIME_ENT_PRTY` (`PARTY_ID`),
  KEY `TIME_ENT_RTTP` (`RATE_TYPE_ID`),
  KEY `TIME_ENT_WEFF` (`WORK_EFFORT_ID`),
  KEY `TIME_ENT_TSHT` (`TIMESHEET_ID`),
  KEY `TIME_ENT_INVIT` (`INVOICE_ID`,`INVOICE_ITEM_SEQ_ID`),
  CONSTRAINT `TIME_ENT_INVIT` FOREIGN KEY (`INVOICE_ID`, `INVOICE_ITEM_SEQ_ID`) REFERENCES `INVOICE_ITEM` (`INVOICE_ID`, `INVOICE_ITEM_SEQ_ID`),
  CONSTRAINT `TIME_ENT_PRTY` FOREIGN KEY (`PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `TIME_ENT_RTTP` FOREIGN KEY (`RATE_TYPE_ID`) REFERENCES `RATE_TYPE` (`RATE_TYPE_ID`),
  CONSTRAINT `TIME_ENT_TSHT` FOREIGN KEY (`TIMESHEET_ID`) REFERENCES `TIMESHEET` (`TIMESHEET_ID`),
  CONSTRAINT `TIME_ENT_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 `TRACKING_CODE`
--

DROP TABLE IF EXISTS `TRACKING_CODE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `TRACKING_CODE` (
  `TRACKING_CODE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `TRACKING_CODE_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `MARKETING_CAMPAIGN_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `REDIRECT_URL` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `OVERRIDE_LOGO` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `OVERRIDE_CSS` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `PROD_CATALOG_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `COMMENTS` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `TRACKABLE_LIFETIME` decimal(20,0) DEFAULT NULL,
  `BILLABLE_LIFETIME` decimal(20,0) DEFAULT NULL,
  `FROM_DATE` datetime DEFAULT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `GROUP_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SUBGROUP_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `CREATED_DATE` datetime DEFAULT NULL,
  `CREATED_BY_USER_LOGIN` varchar(250) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_MODIFIED_DATE` datetime DEFAULT NULL,
  `LAST_MODIFIED_BY_USER_LOGIN` varchar(250) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`TRACKING_CODE_ID`),
  KEY `TKNG_COD_MKCMPN` (`MARKETING_CAMPAIGN_ID`),
  KEY `TKNG_COD_TYP` (`TRACKING_CODE_TYPE_ID`),
  CONSTRAINT `TKNG_COD_MKCMPN` FOREIGN KEY (`MARKETING_CAMPAIGN_ID`) REFERENCES `MARKETING_CAMPAIGN` (`MARKETING_CAMPAIGN_ID`),
  CONSTRAINT `TKNG_COD_TYP` FOREIGN KEY (`TRACKING_CODE_TYPE_ID`) REFERENCES `TRACKING_CODE_TYPE` (`TRACKING_CODE_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `TRACKING_CODE_ORDER`
--

DROP TABLE IF EXISTS `TRACKING_CODE_ORDER`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `TRACKING_CODE_ORDER` (
  `ORDER_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `TRACKING_CODE_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `TRACKING_CODE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `IS_BILLABLE` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `SITE_ID` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `HAS_EXPORTED` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `AFFILIATE_REFERRED_TIME_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`ORDER_ID`,`TRACKING_CODE_TYPE_ID`),
  KEY `TKNG_CODODR_ODR` (`ORDER_ID`),
  KEY `TKNG_CODODR_TKCD` (`TRACKING_CODE_ID`),
  KEY `TKNG_CODODR_TYP` (`TRACKING_CODE_TYPE_ID`),
  CONSTRAINT `TKNG_CODODR_ODR` FOREIGN KEY (`ORDER_ID`) REFERENCES `ORDER_HEADER` (`ORDER_ID`),
  CONSTRAINT `TKNG_CODODR_TKCD` FOREIGN KEY (`TRACKING_CODE_ID`) REFERENCES `TRACKING_CODE` (`TRACKING_CODE_ID`),
  CONSTRAINT `TKNG_CODODR_TYP` FOREIGN KEY (`TRACKING_CODE_TYPE_ID`) REFERENCES `TRACKING_CODE_TYPE` (`TRACKING_CODE_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `TRACKING_CODE_ORDER_RETURN`
--

DROP TABLE IF EXISTS `TRACKING_CODE_ORDER_RETURN`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `TRACKING_CODE_ORDER_RETURN` (
  `RETURN_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ORDER_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ORDER_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `TRACKING_CODE_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `TRACKING_CODE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `IS_BILLABLE` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `SITE_ID` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `HAS_EXPORTED` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `AFFILIATE_REFERRED_TIME_STAMP` 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 (`RETURN_ID`,`ORDER_ID`,`TRACKING_CODE_TYPE_ID`),
  KEY `TKNG_CODODR_RTN` (`RETURN_ID`),
  KEY `TKNG_CODODR_ODRTN` (`ORDER_ID`),
  KEY `TKNG_CODODR_RTNTCD` (`TRACKING_CODE_ID`),
  KEY `TKNG_CODODR_RTNTYP` (`TRACKING_CODE_TYPE_ID`),
  CONSTRAINT `TKNG_CODODR_ODRTN` FOREIGN KEY (`ORDER_ID`) REFERENCES `ORDER_HEADER` (`ORDER_ID`),
  CONSTRAINT `TKNG_CODODR_RTN` FOREIGN KEY (`RETURN_ID`) REFERENCES `RETURN_HEADER` (`RETURN_ID`),
  CONSTRAINT `TKNG_CODODR_RTNTCD` FOREIGN KEY (`TRACKING_CODE_ID`) REFERENCES `TRACKING_CODE` (`TRACKING_CODE_ID`),
  CONSTRAINT `TKNG_CODODR_RTNTYP` FOREIGN KEY (`TRACKING_CODE_TYPE_ID`) REFERENCES `TRACKING_CODE_TYPE` (`TRACKING_CODE_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `TRACKING_CODE_TYPE`
--

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

--
-- Table structure for table `TRACKING_CODE_VISIT`
--

DROP TABLE IF EXISTS `TRACKING_CODE_VISIT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `TRACKING_CODE_VISIT` (
  `TRACKING_CODE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `VISIT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FROM_DATE` datetime NOT NULL,
  `SOURCE_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 (`TRACKING_CODE_ID`,`VISIT_ID`,`FROM_DATE`),
  KEY `TKNG_CODVST_TKCD` (`TRACKING_CODE_ID`),
  KEY `TKNG_CODVST_VST` (`VISIT_ID`),
  KEY `TKNG_CODVST_SRCEM` (`SOURCE_ENUM_ID`),
  CONSTRAINT `TKNG_CODVST_SRCEM` FOREIGN KEY (`SOURCE_ENUM_ID`) REFERENCES `ENUMERATION` (`ENUM_ID`),
  CONSTRAINT `TKNG_CODVST_TKCD` FOREIGN KEY (`TRACKING_CODE_ID`) REFERENCES `TRACKING_CODE` (`TRACKING_CODE_ID`),
  CONSTRAINT `TKNG_CODVST_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 `TRAINING_CLASS_TYPE`
--

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

--
-- Table structure for table `TRAINING_REQUEST`
--

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

--
-- Table structure for table `UNEMPLOYMENT_CLAIM`
--

DROP TABLE IF EXISTS `UNEMPLOYMENT_CLAIM`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `UNEMPLOYMENT_CLAIM` (
  `UNEMPLOYMENT_CLAIM_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `UNEMPLOYMENT_CLAIM_DATE` datetime DEFAULT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `STATUS_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,
  `FROM_DATE` datetime DEFAULT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`UNEMPLOYMENT_CLAIM_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `UOM`
--

DROP TABLE IF EXISTS `UOM`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `UOM` (
  `UOM_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `UOM_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ABBREVIATION` varchar(60) 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 (`UOM_ID`),
  KEY `UOM_TO_TYPE` (`UOM_TYPE_ID`),
  CONSTRAINT `UOM_TO_TYPE` FOREIGN KEY (`UOM_TYPE_ID`) REFERENCES `UOM_TYPE` (`UOM_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `UOM_CONVERSION`
--

DROP TABLE IF EXISTS `UOM_CONVERSION`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `UOM_CONVERSION` (
  `UOM_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `UOM_ID_TO` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CONVERSION_FACTOR` double DEFAULT NULL,
  `CUSTOM_METHOD_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `DECIMAL_SCALE` decimal(20,0) DEFAULT NULL,
  `ROUNDING_MODE` 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 (`UOM_ID`,`UOM_ID_TO`),
  KEY `UOM_CONV_MAIN` (`UOM_ID`),
  KEY `UOM_CONV_TO` (`UOM_ID_TO`),
  KEY `UOM_CUSTOM_METHOD` (`CUSTOM_METHOD_ID`),
  CONSTRAINT `UOM_CONV_MAIN` FOREIGN KEY (`UOM_ID`) REFERENCES `UOM` (`UOM_ID`),
  CONSTRAINT `UOM_CONV_TO` FOREIGN KEY (`UOM_ID_TO`) REFERENCES `UOM` (`UOM_ID`),
  CONSTRAINT `UOM_CUSTOM_METHOD` FOREIGN KEY (`CUSTOM_METHOD_ID`) REFERENCES `CUSTOM_METHOD` (`CUSTOM_METHOD_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `UOM_CONVERSION_DATED`
--

DROP TABLE IF EXISTS `UOM_CONVERSION_DATED`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `UOM_CONVERSION_DATED` (
  `UOM_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `UOM_ID_TO` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FROM_DATE` datetime NOT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `CONVERSION_FACTOR` double DEFAULT NULL,
  `CUSTOM_METHOD_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `DECIMAL_SCALE` decimal(20,0) DEFAULT NULL,
  `ROUNDING_MODE` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PURPOSE_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 (`UOM_ID`,`UOM_ID_TO`,`FROM_DATE`),
  KEY `DATE_UOM_CONV_MAIN` (`UOM_ID`),
  KEY `DATE_UOM_CONV_TO` (`UOM_ID_TO`),
  KEY `UOMD_CUSTOM_METHOD` (`CUSTOM_METHOD_ID`),
  KEY `UOMD_PURPOSE_ENUM` (`PURPOSE_ENUM_ID`),
  CONSTRAINT `DATE_UOM_CONV_MAIN` FOREIGN KEY (`UOM_ID`) REFERENCES `UOM` (`UOM_ID`),
  CONSTRAINT `DATE_UOM_CONV_TO` FOREIGN KEY (`UOM_ID_TO`) REFERENCES `UOM` (`UOM_ID`),
  CONSTRAINT `UOMD_CUSTOM_METHOD` FOREIGN KEY (`CUSTOM_METHOD_ID`) REFERENCES `CUSTOM_METHOD` (`CUSTOM_METHOD_ID`),
  CONSTRAINT `UOMD_PURPOSE_ENUM` FOREIGN KEY (`PURPOSE_ENUM_ID`) REFERENCES `ENUMERATION` (`ENUM_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `UOM_GROUP`
--

DROP TABLE IF EXISTS `UOM_GROUP`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `UOM_GROUP` (
  `UOM_GROUP_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `UOM_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 (`UOM_GROUP_ID`,`UOM_ID`),
  KEY `UOM_GROUP_UOM` (`UOM_ID`),
  CONSTRAINT `UOM_GROUP_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 `UOM_TYPE`
--

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

--
-- Table structure for table `USER_AGENT`
--

DROP TABLE IF EXISTS `USER_AGENT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `USER_AGENT` (
  `USER_AGENT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `BROWSER_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PLATFORM_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PROTOCOL_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `USER_AGENT_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `USER_AGENT_METHOD_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 (`USER_AGENT_ID`),
  KEY `UAGENT_BROWSER` (`BROWSER_TYPE_ID`),
  KEY `UAGENT_PLATFORM` (`PLATFORM_TYPE_ID`),
  KEY `UAGENT_PROTOCOL` (`PROTOCOL_TYPE_ID`),
  KEY `UAGENT_TYPE` (`USER_AGENT_TYPE_ID`),
  KEY `UAGENT_METHOD` (`USER_AGENT_METHOD_TYPE_ID`),
  CONSTRAINT `UAGENT_BROWSER` FOREIGN KEY (`BROWSER_TYPE_ID`) REFERENCES `BROWSER_TYPE` (`BROWSER_TYPE_ID`),
  CONSTRAINT `UAGENT_METHOD` FOREIGN KEY (`USER_AGENT_METHOD_TYPE_ID`) REFERENCES `USER_AGENT_METHOD_TYPE` (`USER_AGENT_METHOD_TYPE_ID`),
  CONSTRAINT `UAGENT_PLATFORM` FOREIGN KEY (`PLATFORM_TYPE_ID`) REFERENCES `PLATFORM_TYPE` (`PLATFORM_TYPE_ID`),
  CONSTRAINT `UAGENT_PROTOCOL` FOREIGN KEY (`PROTOCOL_TYPE_ID`) REFERENCES `PROTOCOL_TYPE` (`PROTOCOL_TYPE_ID`),
  CONSTRAINT `UAGENT_TYPE` FOREIGN KEY (`USER_AGENT_TYPE_ID`) REFERENCES `USER_AGENT_TYPE` (`USER_AGENT_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `USER_AGENT_METHOD_TYPE`
--

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

--
-- Table structure for table `USER_AGENT_TYPE`
--

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

--
-- Table structure for table `USER_LOGIN`
--

DROP TABLE IF EXISTS `USER_LOGIN`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `USER_LOGIN` (
  `USER_LOGIN_ID` varchar(250) COLLATE latin1_general_cs NOT NULL,
  `CURRENT_PASSWORD` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `PASSWORD_HINT` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `IS_SYSTEM` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `ENABLED` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `HAS_LOGGED_OUT` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `REQUIRE_PASSWORD_CHANGE` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_CURRENCY_UOM` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_LOCALE` varchar(10) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_TIME_ZONE` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `DISABLED_DATE_TIME` datetime DEFAULT NULL,
  `SUCCESSIVE_FAILED_LOGINS` decimal(20,0) DEFAULT NULL,
  `EXTERNAL_AUTH_ID` varchar(250) COLLATE latin1_general_cs DEFAULT NULL,
  `USER_LDAP_DN` 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,
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  PRIMARY KEY (`USER_LOGIN_ID`),
  KEY `USER_PARTY` (`PARTY_ID`),
  CONSTRAINT `USER_PARTY` FOREIGN KEY (`PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `USER_LOGIN_HISTORY`
--

DROP TABLE IF EXISTS `USER_LOGIN_HISTORY`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `USER_LOGIN_HISTORY` (
  `USER_LOGIN_ID` varchar(250) COLLATE latin1_general_cs NOT NULL,
  `VISIT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `FROM_DATE` datetime NOT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `PASSWORD_USED` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `SUCCESSFUL_LOGIN` 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,
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  PRIMARY KEY (`USER_LOGIN_ID`,`FROM_DATE`),
  KEY `USER_LH_USER` (`USER_LOGIN_ID`),
  KEY `USER_LH_PARTY` (`PARTY_ID`),
  CONSTRAINT `USER_LH_PARTY` FOREIGN KEY (`PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `USER_LH_USER` FOREIGN KEY (`USER_LOGIN_ID`) REFERENCES `USER_LOGIN` (`USER_LOGIN_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `USER_LOGIN_PASSWORD_HISTORY`
--

DROP TABLE IF EXISTS `USER_LOGIN_PASSWORD_HISTORY`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `USER_LOGIN_PASSWORD_HISTORY` (
  `USER_LOGIN_ID` varchar(250) COLLATE latin1_general_cs NOT NULL,
  `FROM_DATE` datetime NOT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `CURRENT_PASSWORD` 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 (`USER_LOGIN_ID`,`FROM_DATE`),
  KEY `USER_LPH_USER` (`USER_LOGIN_ID`),
  CONSTRAINT `USER_LPH_USER` FOREIGN KEY (`USER_LOGIN_ID`) REFERENCES `USER_LOGIN` (`USER_LOGIN_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `USER_LOGIN_SECURITY_GROUP`
--

DROP TABLE IF EXISTS `USER_LOGIN_SECURITY_GROUP`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `USER_LOGIN_SECURITY_GROUP` (
  `USER_LOGIN_ID` varchar(250) COLLATE latin1_general_cs NOT NULL,
  `GROUP_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FROM_DATE` datetime NOT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`USER_LOGIN_ID`,`GROUP_ID`,`FROM_DATE`),
  KEY `USER_SECGRP_USER` (`USER_LOGIN_ID`),
  KEY `USER_SECGRP_GRP` (`GROUP_ID`),
  CONSTRAINT `USER_SECGRP_GRP` FOREIGN KEY (`GROUP_ID`) REFERENCES `SECURITY_GROUP` (`GROUP_ID`),
  CONSTRAINT `USER_SECGRP_USER` FOREIGN KEY (`USER_LOGIN_ID`) REFERENCES `USER_LOGIN` (`USER_LOGIN_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `USER_LOGIN_SESSION`
--

DROP TABLE IF EXISTS `USER_LOGIN_SESSION`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `USER_LOGIN_SESSION` (
  `USER_LOGIN_ID` varchar(250) COLLATE latin1_general_cs NOT NULL,
  `SAVED_DATE` datetime DEFAULT NULL,
  `SESSION_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 (`USER_LOGIN_ID`),
  KEY `USER_SESSION_USER` (`USER_LOGIN_ID`),
  CONSTRAINT `USER_SESSION_USER` FOREIGN KEY (`USER_LOGIN_ID`) REFERENCES `USER_LOGIN` (`USER_LOGIN_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `USER_PREFERENCE`
--

DROP TABLE IF EXISTS `USER_PREFERENCE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `USER_PREFERENCE` (
  `USER_LOGIN_ID` varchar(250) COLLATE latin1_general_cs NOT NULL,
  `USER_PREF_TYPE_ID` varchar(60) COLLATE latin1_general_cs NOT NULL,
  `USER_PREF_GROUP_TYPE_ID` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `USER_PREF_VALUE` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `USER_PREF_DATA_TYPE` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`USER_LOGIN_ID`,`USER_PREF_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `USER_PREF_GROUP_TYPE`
--

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

--
-- Table structure for table `VALID_CONTACT_MECH_ROLE`
--

DROP TABLE IF EXISTS `VALID_CONTACT_MECH_ROLE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `VALID_CONTACT_MECH_ROLE` (
  `ROLE_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CONTACT_MECH_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 (`ROLE_TYPE_ID`,`CONTACT_MECH_TYPE_ID`),
  KEY `VAL_CMRLE_ROLE` (`ROLE_TYPE_ID`),
  KEY `VAL_CMRLE_CMTYPE` (`CONTACT_MECH_TYPE_ID`),
  CONSTRAINT `VAL_CMRLE_CMTYPE` FOREIGN KEY (`CONTACT_MECH_TYPE_ID`) REFERENCES `CONTACT_MECH_TYPE` (`CONTACT_MECH_TYPE_ID`),
  CONSTRAINT `VAL_CMRLE_ROLE` FOREIGN KEY (`ROLE_TYPE_ID`) REFERENCES `ROLE_TYPE` (`ROLE_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `VALID_RESPONSIBILITY`
--

DROP TABLE IF EXISTS `VALID_RESPONSIBILITY`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `VALID_RESPONSIBILITY` (
  `EMPL_POSITION_TYPE_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_TYPE_ID`,`RESPONSIBILITY_TYPE_ID`,`FROM_DATE`),
  KEY `VALID_RTY_EPSTP` (`EMPL_POSITION_TYPE_ID`),
  KEY `VALID_RTY_RYTP` (`RESPONSIBILITY_TYPE_ID`),
  CONSTRAINT `VALID_RTY_EPSTP` FOREIGN KEY (`EMPL_POSITION_TYPE_ID`) REFERENCES `EMPL_POSITION_TYPE` (`EMPL_POSITION_TYPE_ID`),
  CONSTRAINT `VALID_RTY_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 `VALUE_LINK_FULFILLMENT`
--

DROP TABLE IF EXISTS `VALUE_LINK_FULFILLMENT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `VALUE_LINK_FULFILLMENT` (
  `FULFILLMENT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `TYPE_ENUM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `MERCHANT_ID` varchar(250) COLLATE latin1_general_cs DEFAULT NULL,
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ORDER_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ORDER_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SURVEY_RESPONSE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `CARD_NUMBER` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `PIN_NUMBER` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `AMOUNT` decimal(18,2) DEFAULT NULL,
  `RESPONSE_CODE` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `REFERENCE_NUM` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `AUTH_CODE` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `FULFILLMENT_DATE` datetime DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`FULFILLMENT_ID`),
  KEY `VL_FILL_ENUM` (`TYPE_ENUM_ID`),
  KEY `VL_FILL_PARTY` (`PARTY_ID`),
  KEY `VL_FILL_ODRH` (`ORDER_ID`),
  KEY `VL_FILL_ODRI` (`ORDER_ID`,`ORDER_ITEM_SEQ_ID`),
  KEY `VL_FILL_SURVY` (`SURVEY_RESPONSE_ID`),
  KEY `VL_LNK_FLFLLT_TXSP` (`LAST_UPDATED_TX_STAMP`),
  KEY `VL_LNK_FLFLLT_TXCS` (`CREATED_TX_STAMP`),
  CONSTRAINT `VL_FILL_ENUM` FOREIGN KEY (`TYPE_ENUM_ID`) REFERENCES `ENUMERATION` (`ENUM_ID`),
  CONSTRAINT `VL_FILL_ODRH` FOREIGN KEY (`ORDER_ID`) REFERENCES `ORDER_HEADER` (`ORDER_ID`),
  CONSTRAINT `VL_FILL_ODRI` FOREIGN KEY (`ORDER_ID`, `ORDER_ITEM_SEQ_ID`) REFERENCES `ORDER_ITEM` (`ORDER_ID`, `ORDER_ITEM_SEQ_ID`),
  CONSTRAINT `VL_FILL_PARTY` FOREIGN KEY (`PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `VL_FILL_SURVY` FOREIGN KEY (`SURVEY_RESPONSE_ID`) REFERENCES `SURVEY_RESPONSE` (`SURVEY_RESPONSE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `VALUE_LINK_KEY`
--

DROP TABLE IF EXISTS `VALUE_LINK_KEY`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `VALUE_LINK_KEY` (
  `MERCHANT_ID` varchar(250) COLLATE latin1_general_cs NOT NULL,
  `PUBLIC_KEY` longtext COLLATE latin1_general_cs,
  `PRIVATE_KEY` longtext COLLATE latin1_general_cs,
  `EXCHANGE_KEY` longtext COLLATE latin1_general_cs,
  `WORKING_KEY` longtext COLLATE latin1_general_cs,
  `WORKING_KEY_INDEX` decimal(20,0) DEFAULT NULL,
  `LAST_WORKING_KEY` longtext COLLATE latin1_general_cs,
  `CREATED_DATE` datetime DEFAULT NULL,
  `CREATED_BY_TERMINAL` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `CREATED_BY_USER_LOGIN` varchar(250) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_MODIFIED_DATE` datetime DEFAULT NULL,
  `LAST_MODIFIED_BY_TERMINAL` varchar(60) 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 (`MERCHANT_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `VARIANCE_REASON`
--

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

--
-- Table structure for table `VARIANCE_REASON_GL_ACCOUNT`
--

DROP TABLE IF EXISTS `VARIANCE_REASON_GL_ACCOUNT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `VARIANCE_REASON_GL_ACCOUNT` (
  `VARIANCE_REASON_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ORGANIZATION_PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `GL_ACCOUNT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`VARIANCE_REASON_ID`,`ORGANIZATION_PARTY_ID`),
  KEY `VRGL_VREAS` (`VARIANCE_REASON_ID`),
  KEY `VRGL_PARTY` (`ORGANIZATION_PARTY_ID`),
  KEY `VRGL_GLACCT` (`GL_ACCOUNT_ID`),
  CONSTRAINT `VRGL_GLACCT` FOREIGN KEY (`GL_ACCOUNT_ID`) REFERENCES `GL_ACCOUNT` (`GL_ACCOUNT_ID`),
  CONSTRAINT `VRGL_PARTY` FOREIGN KEY (`ORGANIZATION_PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `VRGL_VREAS` FOREIGN KEY (`VARIANCE_REASON_ID`) REFERENCES `VARIANCE_REASON` (`VARIANCE_REASON_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `VENDOR`
--

DROP TABLE IF EXISTS `VENDOR`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `VENDOR` (
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `MANIFEST_COMPANY_NAME` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `MANIFEST_COMPANY_TITLE` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `MANIFEST_LOGO_URL` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `MANIFEST_POLICIES` 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 (`PARTY_ID`),
  KEY `VENDOR_PARTY` (`PARTY_ID`),
  CONSTRAINT `VENDOR_PARTY` FOREIGN KEY (`PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `VENDOR_PRODUCT`
--

DROP TABLE IF EXISTS `VENDOR_PRODUCT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `VENDOR_PRODUCT` (
  `PRODUCT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `VENDOR_PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_STORE_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 (`PRODUCT_ID`,`VENDOR_PARTY_ID`,`PRODUCT_STORE_GROUP_ID`),
  KEY `VENDPROD_PROD` (`PRODUCT_ID`),
  KEY `VENDPROD_VPTY` (`VENDOR_PARTY_ID`),
  KEY `VENDPROD_PSGRP` (`PRODUCT_STORE_GROUP_ID`),
  CONSTRAINT `VENDPROD_PROD` FOREIGN KEY (`PRODUCT_ID`) REFERENCES `PRODUCT` (`PRODUCT_ID`),
  CONSTRAINT `VENDPROD_PSGRP` FOREIGN KEY (`PRODUCT_STORE_GROUP_ID`) REFERENCES `PRODUCT_STORE_GROUP` (`PRODUCT_STORE_GROUP_ID`),
  CONSTRAINT `VENDPROD_VPTY` FOREIGN KEY (`VENDOR_PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `VIDEO_DATA_RESOURCE`
--

DROP TABLE IF EXISTS `VIDEO_DATA_RESOURCE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `VIDEO_DATA_RESOURCE` (
  `DATA_RESOURCE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `VIDEO_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_VIDEO` (`DATA_RESOURCE_ID`),
  CONSTRAINT `DATA_REC_VIDEO` 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 `VISIT`
--

DROP TABLE IF EXISTS `VISIT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `VISIT` (
  `VISIT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `VISITOR_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `USER_LOGIN_ID` varchar(250) COLLATE latin1_general_cs DEFAULT NULL,
  `USER_CREATED` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `SESSION_ID` varchar(250) COLLATE latin1_general_cs DEFAULT NULL,
  `SERVER_IP_ADDRESS` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SERVER_HOST_NAME` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `WEBAPP_NAME` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `INITIAL_LOCALE` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `INITIAL_REQUEST` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `INITIAL_REFERRER` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `INITIAL_USER_AGENT` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `USER_AGENT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `CLIENT_IP_ADDRESS` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `CLIENT_HOST_NAME` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `CLIENT_USER` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `CLIENT_IP_ISP_NAME` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `CLIENT_IP_POSTAL_CODE` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `CLIENT_IP_STATE_PROV_GEO_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `CLIENT_IP_COUNTRY_GEO_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `COOKIE` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `FROM_DATE` datetime DEFAULT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  `CONTACT_MECH_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,
  PRIMARY KEY (`VISIT_ID`),
  KEY `VISIT_VISITOR` (`VISITOR_ID`),
  KEY `VISIT_USER_AGNT` (`USER_AGENT_ID`),
  KEY `VISIT_CIP_STPRV` (`CLIENT_IP_STATE_PROV_GEO_ID`),
  KEY `VISIT_CIP_CNTRY` (`CLIENT_IP_COUNTRY_GEO_ID`),
  KEY `VISIT_CONT_MECH` (`CONTACT_MECH_ID`),
  KEY `VISIT_PARTY` (`PARTY_ID`),
  KEY `VISIT_ROLE_TYPE` (`ROLE_TYPE_ID`),
  KEY `VISIT_PARTY_ROLE` (`PARTY_ID`,`ROLE_TYPE_ID`),
  CONSTRAINT `VISIT_CIP_CNTRY` FOREIGN KEY (`CLIENT_IP_COUNTRY_GEO_ID`) REFERENCES `GEO` (`GEO_ID`),
  CONSTRAINT `VISIT_CIP_STPRV` FOREIGN KEY (`CLIENT_IP_STATE_PROV_GEO_ID`) REFERENCES `GEO` (`GEO_ID`),
  CONSTRAINT `VISIT_CONT_MECH` FOREIGN KEY (`CONTACT_MECH_ID`) REFERENCES `CONTACT_MECH` (`CONTACT_MECH_ID`),
  CONSTRAINT `VISIT_PARTY` FOREIGN KEY (`PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `VISIT_PARTY_ROLE` FOREIGN KEY (`PARTY_ID`, `ROLE_TYPE_ID`) REFERENCES `PARTY_ROLE` (`PARTY_ID`, `ROLE_TYPE_ID`),
  CONSTRAINT `VISIT_ROLE_TYPE` FOREIGN KEY (`ROLE_TYPE_ID`) REFERENCES `ROLE_TYPE` (`ROLE_TYPE_ID`),
  CONSTRAINT `VISIT_USER_AGNT` FOREIGN KEY (`USER_AGENT_ID`) REFERENCES `USER_AGENT` (`USER_AGENT_ID`),
  CONSTRAINT `VISIT_VISITOR` FOREIGN KEY (`VISITOR_ID`) REFERENCES `VISITOR` (`VISITOR_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `VISITOR`
--

DROP TABLE IF EXISTS `VISITOR`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `VISITOR` (
  `VISITOR_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `USER_LOGIN_ID` varchar(250) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  PRIMARY KEY (`VISITOR_ID`),
  KEY `VISITOR_USRLGN` (`USER_LOGIN_ID`),
  KEY `VISITOR_PARTY` (`PARTY_ID`),
  CONSTRAINT `VISITOR_PARTY` FOREIGN KEY (`PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `VISITOR_USRLGN` FOREIGN KEY (`USER_LOGIN_ID`) REFERENCES `USER_LOGIN` (`USER_LOGIN_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `VISUAL_THEME`
--

DROP TABLE IF EXISTS `VISUAL_THEME`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `VISUAL_THEME` (
  `VISUAL_THEME_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `VISUAL_THEME_SET_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 (`VISUAL_THEME_ID`),
  KEY `VT_THEME_SET` (`VISUAL_THEME_SET_ID`),
  CONSTRAINT `VT_THEME_SET` FOREIGN KEY (`VISUAL_THEME_SET_ID`) REFERENCES `VISUAL_THEME_SET` (`VISUAL_THEME_SET_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `VISUAL_THEME_RESOURCE`
--

DROP TABLE IF EXISTS `VISUAL_THEME_RESOURCE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `VISUAL_THEME_RESOURCE` (
  `VISUAL_THEME_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `RESOURCE_TYPE_ENUM_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `SEQUENCE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `RESOURCE_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 (`VISUAL_THEME_ID`,`RESOURCE_TYPE_ENUM_ID`,`SEQUENCE_ID`),
  KEY `VT_RES_THEME` (`VISUAL_THEME_ID`),
  KEY `VT_RES_TYPE_ENUM` (`RESOURCE_TYPE_ENUM_ID`),
  CONSTRAINT `VT_RES_THEME` FOREIGN KEY (`VISUAL_THEME_ID`) REFERENCES `VISUAL_THEME` (`VISUAL_THEME_ID`),
  CONSTRAINT `VT_RES_TYPE_ENUM` FOREIGN KEY (`RESOURCE_TYPE_ENUM_ID`) REFERENCES `ENUMERATION` (`ENUM_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `VISUAL_THEME_SET`
--

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

--
-- Table structure for table `WEB_ANALYTICS_CONFIG`
--

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

--
-- Table structure for table `WEB_ANALYTICS_TYPE`
--

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

--
-- Table structure for table `WEB_PAGE`
--

DROP TABLE IF EXISTS `WEB_PAGE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `WEB_PAGE` (
  `WEB_PAGE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PAGE_NAME` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `WEB_SITE_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,
  `CONTENT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  PRIMARY KEY (`WEB_PAGE_ID`),
  KEY `WEB_PAGE_SITE` (`WEB_SITE_ID`),
  KEY `WEB_PAGE_CONTENT` (`CONTENT_ID`),
  CONSTRAINT `WEB_PAGE_CONTENT` FOREIGN KEY (`CONTENT_ID`) REFERENCES `CONTENT` (`CONTENT_ID`),
  CONSTRAINT `WEB_PAGE_SITE` FOREIGN KEY (`WEB_SITE_ID`) REFERENCES `WEB_SITE` (`WEB_SITE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `WEB_PREFERENCE_TYPE`
--

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

--
-- Table structure for table `WEB_SITE`
--

DROP TABLE IF EXISTS `WEB_SITE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `WEB_SITE` (
  `WEB_SITE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `SITE_NAME` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `HTTP_HOST` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `HTTP_PORT` varchar(10) COLLATE latin1_general_cs DEFAULT NULL,
  `HTTPS_HOST` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `HTTPS_PORT` varchar(10) COLLATE latin1_general_cs DEFAULT NULL,
  `ENABLE_HTTPS` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `STANDARD_CONTENT_PREFIX` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `SECURE_CONTENT_PREFIX` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `COOKIE_DOMAIN` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `VISUAL_THEME_SET_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,
  `PRODUCT_STORE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ALLOW_PRODUCT_STORE_CHANGE` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  PRIMARY KEY (`WEB_SITE_ID`),
  KEY `WEB_SITE_THEME_SET` (`VISUAL_THEME_SET_ID`),
  KEY `WEB_SITE_PRDS` (`PRODUCT_STORE_ID`),
  CONSTRAINT `WEB_SITE_PRDS` FOREIGN KEY (`PRODUCT_STORE_ID`) REFERENCES `PRODUCT_STORE` (`PRODUCT_STORE_ID`),
  CONSTRAINT `WEB_SITE_THEME_SET` FOREIGN KEY (`VISUAL_THEME_SET_ID`) REFERENCES `VISUAL_THEME_SET` (`VISUAL_THEME_SET_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `WEB_SITE_CONTACT_LIST`
--

DROP TABLE IF EXISTS `WEB_SITE_CONTACT_LIST`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `WEB_SITE_CONTACT_LIST` (
  `WEB_SITE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CONTACT_LIST_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 (`WEB_SITE_ID`,`CONTACT_LIST_ID`,`FROM_DATE`),
  KEY `WEB_SITE_CNTCT_LST` (`WEB_SITE_ID`),
  KEY `CNTCT_LST_WEB_SITE` (`CONTACT_LIST_ID`),
  CONSTRAINT `CNTCT_LST_WEB_SITE` FOREIGN KEY (`CONTACT_LIST_ID`) REFERENCES `CONTACT_LIST` (`CONTACT_LIST_ID`),
  CONSTRAINT `WEB_SITE_CNTCT_LST` FOREIGN KEY (`WEB_SITE_ID`) REFERENCES `WEB_SITE` (`WEB_SITE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `WEB_SITE_CONTENT`
--

DROP TABLE IF EXISTS `WEB_SITE_CONTENT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `WEB_SITE_CONTENT` (
  `WEB_SITE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CONTENT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `WEB_SITE_CONTENT_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FROM_DATE` datetime NOT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`WEB_SITE_ID`,`CONTENT_ID`,`WEB_SITE_CONTENT_TYPE_ID`,`FROM_DATE`),
  KEY `WSCTNT_WEBSITE` (`WEB_SITE_ID`),
  KEY `WSCTNT_CONTENT` (`CONTENT_ID`),
  KEY `WSCTNT_WSCTTYPE` (`WEB_SITE_CONTENT_TYPE_ID`),
  CONSTRAINT `WSCTNT_CONTENT` FOREIGN KEY (`CONTENT_ID`) REFERENCES `CONTENT` (`CONTENT_ID`),
  CONSTRAINT `WSCTNT_WEBSITE` FOREIGN KEY (`WEB_SITE_ID`) REFERENCES `WEB_SITE` (`WEB_SITE_ID`),
  CONSTRAINT `WSCTNT_WSCTTYPE` FOREIGN KEY (`WEB_SITE_CONTENT_TYPE_ID`) REFERENCES `WEB_SITE_CONTENT_TYPE` (`WEB_SITE_CONTENT_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `WEB_SITE_CONTENT_TYPE`
--

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

--
-- Table structure for table `WEB_SITE_PATH_ALIAS`
--

DROP TABLE IF EXISTS `WEB_SITE_PATH_ALIAS`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `WEB_SITE_PATH_ALIAS` (
  `WEB_SITE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PATH_ALIAS` varchar(250) COLLATE latin1_general_cs NOT NULL,
  `ALIAS_TO` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `CONTENT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `MAP_KEY` 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 (`WEB_SITE_ID`,`PATH_ALIAS`),
  KEY `WSPATH_WEBSITE` (`WEB_SITE_ID`),
  KEY `WSPATH_CONTENT` (`CONTENT_ID`),
  CONSTRAINT `WSPATH_CONTENT` FOREIGN KEY (`CONTENT_ID`) REFERENCES `CONTENT` (`CONTENT_ID`),
  CONSTRAINT `WSPATH_WEBSITE` FOREIGN KEY (`WEB_SITE_ID`) REFERENCES `WEB_SITE` (`WEB_SITE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `WEB_SITE_PUBLISH_POINT`
--

DROP TABLE IF EXISTS `WEB_SITE_PUBLISH_POINT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `WEB_SITE_PUBLISH_POINT` (
  `CONTENT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `TEMPLATE_TITLE` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `STYLE_SHEET_FILE` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LOGO` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `MEDALLION_LOGO` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LINE_LOGO` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LEFT_BAR_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `RIGHT_BAR_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `CONTENT_DEPT` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ABOUT_CONTENT_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`),
  KEY `WBSTPP_CONTENT` (`CONTENT_ID`),
  CONSTRAINT `WBSTPP_CONTENT` 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 `WEB_SITE_ROLE`
--

DROP TABLE IF EXISTS `WEB_SITE_ROLE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `WEB_SITE_ROLE` (
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ROLE_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `WEB_SITE_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 (`PARTY_ID`,`ROLE_TYPE_ID`,`WEB_SITE_ID`,`FROM_DATE`),
  KEY `WSRLE_PTYRLE` (`PARTY_ID`,`ROLE_TYPE_ID`),
  KEY `WSRLE_WSITE` (`WEB_SITE_ID`),
  CONSTRAINT `WSRLE_PTYRLE` FOREIGN KEY (`PARTY_ID`, `ROLE_TYPE_ID`) REFERENCES `PARTY_ROLE` (`PARTY_ID`, `ROLE_TYPE_ID`),
  CONSTRAINT `WSRLE_WSITE` FOREIGN KEY (`WEB_SITE_ID`) REFERENCES `WEB_SITE` (`WEB_SITE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `WEB_USER_PREFERENCE`
--

DROP TABLE IF EXISTS `WEB_USER_PREFERENCE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `WEB_USER_PREFERENCE` (
  `USER_LOGIN_ID` varchar(250) COLLATE latin1_general_cs NOT NULL,
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `VISIT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `WEB_PREFERENCE_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `WEB_PREFERENCE_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 (`USER_LOGIN_ID`,`PARTY_ID`,`VISIT_ID`,`WEB_PREFERENCE_TYPE_ID`),
  KEY `WEB_PREF_TYPE` (`WEB_PREFERENCE_TYPE_ID`),
  KEY `WEB_PREF_USER` (`USER_LOGIN_ID`),
  KEY `WEB_PREF_PARTY` (`PARTY_ID`),
  CONSTRAINT `WEB_PREF_PARTY` FOREIGN KEY (`PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `WEB_PREF_TYPE` FOREIGN KEY (`WEB_PREFERENCE_TYPE_ID`) REFERENCES `WEB_PREFERENCE_TYPE` (`WEB_PREFERENCE_TYPE_ID`),
  CONSTRAINT `WEB_PREF_USER` FOREIGN KEY (`USER_LOGIN_ID`) REFERENCES `USER_LOGIN` (`USER_LOGIN_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `WORK_EFFORT`
--

DROP TABLE IF EXISTS `WORK_EFFORT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `WORK_EFFORT` (
  `WORK_EFFORT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `WORK_EFFORT_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `CURRENT_STATUS_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_STATUS_UPDATE` datetime DEFAULT NULL,
  `WORK_EFFORT_PURPOSE_TYPE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `WORK_EFFORT_PARENT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SCOPE_ENUM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PRIORITY` decimal(20,0) DEFAULT NULL,
  `PERCENT_COMPLETE` decimal(20,0) DEFAULT NULL,
  `WORK_EFFORT_NAME` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `SHOW_AS_ENUM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SEND_NOTIFICATION_EMAIL` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `DESCRIPTION` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LOCATION_DESC` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `ESTIMATED_START_DATE` datetime DEFAULT NULL,
  `ESTIMATED_COMPLETION_DATE` datetime DEFAULT NULL,
  `ACTUAL_START_DATE` datetime DEFAULT NULL,
  `ACTUAL_COMPLETION_DATE` datetime DEFAULT NULL,
  `ESTIMATED_MILLI_SECONDS` double DEFAULT NULL,
  `ESTIMATED_SETUP_MILLIS` double DEFAULT NULL,
  `ESTIMATE_CALC_METHOD` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ACTUAL_MILLI_SECONDS` double DEFAULT NULL,
  `ACTUAL_SETUP_MILLIS` double DEFAULT NULL,
  `TOTAL_MILLI_SECONDS_ALLOWED` double DEFAULT NULL,
  `TOTAL_MONEY_ALLOWED` decimal(18,2) DEFAULT NULL,
  `MONEY_UOM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SPECIAL_TERMS` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `TIME_TRANSPARENCY` decimal(20,0) DEFAULT NULL,
  `UNIVERSAL_ID` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `SOURCE_REFERENCE_ID` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `FIXED_ASSET_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `FACILITY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `INFO_URL` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `RECURRENCE_INFO_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `TEMP_EXPR_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `RUNTIME_DATA_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `NOTE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `SERVICE_LOADER_NAME` varchar(100) COLLATE latin1_general_cs DEFAULT NULL,
  `QUANTITY_TO_PRODUCE` decimal(18,6) DEFAULT NULL,
  `QUANTITY_PRODUCED` decimal(18,6) DEFAULT NULL,
  `QUANTITY_REJECTED` decimal(18,6) DEFAULT NULL,
  `RESERV_PERSONS` decimal(18,6) DEFAULT NULL,
  `RESERV2ND_P_P_PERC` decimal(18,6) DEFAULT NULL,
  `RESERV_NTH_P_P_PERC` decimal(18,6) DEFAULT NULL,
  `ACCOMMODATION_MAP_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ACCOMMODATION_SPOT_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `REVISION_NUMBER` 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 (`WORK_EFFORT_ID`),
  KEY `WK_EFFRT_TYPE` (`WORK_EFFORT_TYPE_ID`),
  KEY `WK_EFFRT_PRPTYP` (`WORK_EFFORT_PURPOSE_TYPE_ID`),
  KEY `WK_EFFRT_PARENT` (`WORK_EFFORT_PARENT_ID`),
  KEY `WK_EFFRT_CURSTTS` (`CURRENT_STATUS_ID`),
  KEY `WK_EFFRT_SC_ENUM` (`SCOPE_ENUM_ID`),
  KEY `WK_EFFRT_FXDASST` (`FIXED_ASSET_ID`),
  KEY `WK_EFFRT_FACILITY` (`FACILITY_ID`),
  KEY `WK_EFFRT_MON_UOM` (`MONEY_UOM_ID`),
  KEY `WK_EFFRT_RECINFO` (`RECURRENCE_INFO_ID`),
  KEY `WK_EFFRT_TEMPEXPR` (`TEMP_EXPR_ID`),
  KEY `WK_EFFRT_RNTMDTA` (`RUNTIME_DATA_ID`),
  KEY `WK_EFFRT_NOTE` (`NOTE_ID`),
  KEY `WK_EFFRT_CUS_MET` (`ESTIMATE_CALC_METHOD`),
  KEY `WK_EFFRT_ACC_MAP` (`ACCOMMODATION_MAP_ID`),
  KEY `WK_EFFRT_ACC_SPOT` (`ACCOMMODATION_SPOT_ID`),
  CONSTRAINT `WK_EFFRT_ACC_MAP` FOREIGN KEY (`ACCOMMODATION_MAP_ID`) REFERENCES `ACCOMMODATION_MAP` (`ACCOMMODATION_MAP_ID`),
  CONSTRAINT `WK_EFFRT_ACC_SPOT` FOREIGN KEY (`ACCOMMODATION_SPOT_ID`) REFERENCES `ACCOMMODATION_SPOT` (`ACCOMMODATION_SPOT_ID`),
  CONSTRAINT `WK_EFFRT_CURSTTS` FOREIGN KEY (`CURRENT_STATUS_ID`) REFERENCES `STATUS_ITEM` (`STATUS_ID`),
  CONSTRAINT `WK_EFFRT_CUS_MET` FOREIGN KEY (`ESTIMATE_CALC_METHOD`) REFERENCES `CUSTOM_METHOD` (`CUSTOM_METHOD_ID`),
  CONSTRAINT `WK_EFFRT_FACILITY` FOREIGN KEY (`FACILITY_ID`) REFERENCES `FACILITY` (`FACILITY_ID`),
  CONSTRAINT `WK_EFFRT_FXDASST` FOREIGN KEY (`FIXED_ASSET_ID`) REFERENCES `FIXED_ASSET` (`FIXED_ASSET_ID`),
  CONSTRAINT `WK_EFFRT_MON_UOM` FOREIGN KEY (`MONEY_UOM_ID`) REFERENCES `UOM` (`UOM_ID`),
  CONSTRAINT `WK_EFFRT_NOTE` FOREIGN KEY (`NOTE_ID`) REFERENCES `NOTE_DATA` (`NOTE_ID`),
  CONSTRAINT `WK_EFFRT_PARENT` FOREIGN KEY (`WORK_EFFORT_PARENT_ID`) REFERENCES `WORK_EFFORT` (`WORK_EFFORT_ID`),
  CONSTRAINT `WK_EFFRT_PRPTYP` FOREIGN KEY (`WORK_EFFORT_PURPOSE_TYPE_ID`) REFERENCES `WORK_EFFORT_PURPOSE_TYPE` (`WORK_EFFORT_PURPOSE_TYPE_ID`),
  CONSTRAINT `WK_EFFRT_RECINFO` FOREIGN KEY (`RECURRENCE_INFO_ID`) REFERENCES `RECURRENCE_INFO` (`RECURRENCE_INFO_ID`),
  CONSTRAINT `WK_EFFRT_RNTMDTA` FOREIGN KEY (`RUNTIME_DATA_ID`) REFERENCES `RUNTIME_DATA` (`RUNTIME_DATA_ID`),
  CONSTRAINT `WK_EFFRT_SC_ENUM` FOREIGN KEY (`SCOPE_ENUM_ID`) REFERENCES `ENUMERATION` (`ENUM_ID`),
  CONSTRAINT `WK_EFFRT_TEMPEXPR` FOREIGN KEY (`TEMP_EXPR_ID`) REFERENCES `TEMPORAL_EXPRESSION` (`TEMP_EXPR_ID`),
  CONSTRAINT `WK_EFFRT_TYPE` FOREIGN KEY (`WORK_EFFORT_TYPE_ID`) REFERENCES `WORK_EFFORT_TYPE` (`WORK_EFFORT_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `WORK_EFFORT_ASSIGNMENT_RATE`
--

DROP TABLE IF EXISTS `WORK_EFFORT_ASSIGNMENT_RATE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `WORK_EFFORT_ASSIGNMENT_RATE` (
  `WORK_EFFORT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `RATE_TYPE_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,
  `RATE` decimal(18,2) DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`WORK_EFFORT_ID`,`RATE_TYPE_ID`,`PARTY_ID`,`FROM_DATE`),
  KEY `WEFF_ASRT_WEFF` (`WORK_EFFORT_ID`),
  KEY `WEFF_ASRT_RATETP` (`RATE_TYPE_ID`),
  KEY `WEFF_ASRT_PRTY` (`PARTY_ID`),
  KEY `WRK_EFT_ASST_RT_TP` (`LAST_UPDATED_TX_STAMP`),
  KEY `WRK_EFT_ASST_RT_TS` (`CREATED_TX_STAMP`),
  CONSTRAINT `WEFF_ASRT_PRTY` FOREIGN KEY (`PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `WEFF_ASRT_RATETP` FOREIGN KEY (`RATE_TYPE_ID`) REFERENCES `RATE_TYPE` (`RATE_TYPE_ID`),
  CONSTRAINT `WEFF_ASRT_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 `WORK_EFFORT_ASSOC`
--

DROP TABLE IF EXISTS `WORK_EFFORT_ASSOC`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `WORK_EFFORT_ASSOC` (
  `WORK_EFFORT_ID_FROM` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `WORK_EFFORT_ID_TO` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `WORK_EFFORT_ASSOC_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `SEQUENCE_NUM` decimal(20,0) 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 (`WORK_EFFORT_ID_FROM`,`WORK_EFFORT_ID_TO`,`WORK_EFFORT_ASSOC_TYPE_ID`,`FROM_DATE`),
  KEY `WK_EFFRTASSC_TYP` (`WORK_EFFORT_ASSOC_TYPE_ID`),
  KEY `WK_EFFRTASSC_FWE` (`WORK_EFFORT_ID_FROM`),
  KEY `WK_EFFRTASSC_TWE` (`WORK_EFFORT_ID_TO`),
  CONSTRAINT `WK_EFFRTASSC_FWE` FOREIGN KEY (`WORK_EFFORT_ID_FROM`) REFERENCES `WORK_EFFORT` (`WORK_EFFORT_ID`),
  CONSTRAINT `WK_EFFRTASSC_TWE` FOREIGN KEY (`WORK_EFFORT_ID_TO`) REFERENCES `WORK_EFFORT` (`WORK_EFFORT_ID`),
  CONSTRAINT `WK_EFFRTASSC_TYP` FOREIGN KEY (`WORK_EFFORT_ASSOC_TYPE_ID`) REFERENCES `WORK_EFFORT_ASSOC_TYPE` (`WORK_EFFORT_ASSOC_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `WORK_EFFORT_ASSOC_ATTRIBUTE`
--

DROP TABLE IF EXISTS `WORK_EFFORT_ASSOC_ATTRIBUTE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `WORK_EFFORT_ASSOC_ATTRIBUTE` (
  `WORK_EFFORT_ID_FROM` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `WORK_EFFORT_ID_TO` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `WORK_EFFORT_ASSOC_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FROM_DATE` datetime DEFAULT 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 (`WORK_EFFORT_ID_FROM`,`WORK_EFFORT_ID_TO`,`WORK_EFFORT_ASSOC_TYPE_ID`,`ATTR_NAME`),
  KEY `WK_EFFRTASSC_ATTR` (`WORK_EFFORT_ID_FROM`,`WORK_EFFORT_ID_TO`,`WORK_EFFORT_ASSOC_TYPE_ID`,`FROM_DATE`),
  CONSTRAINT `WK_EFFRTASSC_ATTR` FOREIGN KEY (`WORK_EFFORT_ID_FROM`, `WORK_EFFORT_ID_TO`, `WORK_EFFORT_ASSOC_TYPE_ID`, `FROM_DATE`) REFERENCES `WORK_EFFORT_ASSOC` (`WORK_EFFORT_ID_FROM`, `WORK_EFFORT_ID_TO`, `WORK_EFFORT_ASSOC_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 `WORK_EFFORT_ASSOC_TYPE`
--

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

--
-- Table structure for table `WORK_EFFORT_ASSOC_TYPE_ATTR`
--

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

--
-- Table structure for table `WORK_EFFORT_ATTRIBUTE`
--

DROP TABLE IF EXISTS `WORK_EFFORT_ATTRIBUTE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `WORK_EFFORT_ATTRIBUTE` (
  `WORK_EFFORT_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 (`WORK_EFFORT_ID`,`ATTR_NAME`),
  KEY `WK_EFFRT_ATTR_WE` (`WORK_EFFORT_ID`),
  CONSTRAINT `WK_EFFRT_ATTR_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 `WORK_EFFORT_BILLING`
--

DROP TABLE IF EXISTS `WORK_EFFORT_BILLING`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `WORK_EFFORT_BILLING` (
  `WORK_EFFORT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `INVOICE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `INVOICE_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `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 (`WORK_EFFORT_ID`,`INVOICE_ID`,`INVOICE_ITEM_SEQ_ID`),
  KEY `WK_EFFBLNG_WEFF` (`WORK_EFFORT_ID`),
  KEY `WK_EFFBLNG_INVITM` (`INVOICE_ID`,`INVOICE_ITEM_SEQ_ID`),
  CONSTRAINT `WK_EFFBLNG_INVITM` FOREIGN KEY (`INVOICE_ID`, `INVOICE_ITEM_SEQ_ID`) REFERENCES `INVOICE_ITEM` (`INVOICE_ID`, `INVOICE_ITEM_SEQ_ID`),
  CONSTRAINT `WK_EFFBLNG_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 `WORK_EFFORT_CONTACT_MECH`
--

DROP TABLE IF EXISTS `WORK_EFFORT_CONTACT_MECH`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `WORK_EFFORT_CONTACT_MECH` (
  `WORK_EFFORT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CONTACT_MECH_ID` varchar(20) COLLATE latin1_general_cs NOT 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 (`WORK_EFFORT_ID`,`CONTACT_MECH_ID`),
  KEY `OLWKEF_CMECH_WKEFF` (`WORK_EFFORT_ID`),
  KEY `OLWKEF_CMECH_CMECH` (`CONTACT_MECH_ID`),
  KEY `WRK_EFT_CNT_MCH_TP` (`LAST_UPDATED_TX_STAMP`),
  KEY `WRK_EFT_CNT_MCH_TS` (`CREATED_TX_STAMP`),
  CONSTRAINT `OLWKEF_CMECH_CMECH` FOREIGN KEY (`CONTACT_MECH_ID`) REFERENCES `CONTACT_MECH` (`CONTACT_MECH_ID`),
  CONSTRAINT `OLWKEF_CMECH_WKEFF` 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 `WORK_EFFORT_CONTACT_MECH_NEW`
--

DROP TABLE IF EXISTS `WORK_EFFORT_CONTACT_MECH_NEW`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `WORK_EFFORT_CONTACT_MECH_NEW` (
  `WORK_EFFORT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CONTACT_MECH_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FROM_DATE` datetime NOT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `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 (`WORK_EFFORT_ID`,`CONTACT_MECH_ID`,`FROM_DATE`),
  KEY `WKEFF_CMECH_WKEFF` (`WORK_EFFORT_ID`),
  KEY `WKEFF_CMECH_CMECH` (`CONTACT_MECH_ID`),
  CONSTRAINT `WKEFF_CMECH_CMECH` FOREIGN KEY (`CONTACT_MECH_ID`) REFERENCES `CONTACT_MECH` (`CONTACT_MECH_ID`),
  CONSTRAINT `WKEFF_CMECH_WKEFF` 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 `WORK_EFFORT_CONTENT`
--

DROP TABLE IF EXISTS `WORK_EFFORT_CONTENT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `WORK_EFFORT_CONTENT` (
  `WORK_EFFORT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CONTENT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `WORK_EFFORT_CONTENT_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FROM_DATE` datetime NOT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`WORK_EFFORT_ID`,`CONTENT_ID`,`WORK_EFFORT_CONTENT_TYPE_ID`,`FROM_DATE`),
  KEY `WKEFF_CNT_WKEFF` (`WORK_EFFORT_ID`),
  KEY `WKEFF_CNT_CNT` (`CONTENT_ID`),
  KEY `WKEFF_CNT_WCTP` (`WORK_EFFORT_CONTENT_TYPE_ID`),
  CONSTRAINT `WKEFF_CNT_CNT` FOREIGN KEY (`CONTENT_ID`) REFERENCES `CONTENT` (`CONTENT_ID`),
  CONSTRAINT `WKEFF_CNT_WCTP` FOREIGN KEY (`WORK_EFFORT_CONTENT_TYPE_ID`) REFERENCES `WORK_EFFORT_CONTENT_TYPE` (`WORK_EFFORT_CONTENT_TYPE_ID`),
  CONSTRAINT `WKEFF_CNT_WKEFF` 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 `WORK_EFFORT_CONTENT_TYPE`
--

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

--
-- Table structure for table `WORK_EFFORT_COST_CALC`
--

DROP TABLE IF EXISTS `WORK_EFFORT_COST_CALC`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `WORK_EFFORT_COST_CALC` (
  `WORK_EFFORT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `COST_COMPONENT_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `COST_COMPONENT_CALC_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `FROM_DATE` datetime NOT NULL,
  `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 (`WORK_EFFORT_ID`,`COST_COMPONENT_TYPE_ID`,`FROM_DATE`),
  KEY `WK_EFFRT_COS_WEF` (`WORK_EFFORT_ID`),
  KEY `WK_EFFRT_COS_CCT` (`COST_COMPONENT_TYPE_ID`),
  KEY `WK_EFFRT_COS_CCC` (`COST_COMPONENT_CALC_ID`),
  CONSTRAINT `WK_EFFRT_COS_CCC` FOREIGN KEY (`COST_COMPONENT_CALC_ID`) REFERENCES `COST_COMPONENT_CALC` (`COST_COMPONENT_CALC_ID`),
  CONSTRAINT `WK_EFFRT_COS_CCT` FOREIGN KEY (`COST_COMPONENT_TYPE_ID`) REFERENCES `COST_COMPONENT_TYPE` (`COST_COMPONENT_TYPE_ID`),
  CONSTRAINT `WK_EFFRT_COS_WEF` 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 `WORK_EFFORT_DELIVERABLE_PROD`
--

DROP TABLE IF EXISTS `WORK_EFFORT_DELIVERABLE_PROD`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `WORK_EFFORT_DELIVERABLE_PROD` (
  `WORK_EFFORT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `DELIVERABLE_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 (`WORK_EFFORT_ID`,`DELIVERABLE_ID`),
  KEY `WKEFF_DELPRD_WEFF` (`WORK_EFFORT_ID`),
  KEY `WKEFF_DELPRD_DEL` (`DELIVERABLE_ID`),
  CONSTRAINT `WKEFF_DELPRD_DEL` FOREIGN KEY (`DELIVERABLE_ID`) REFERENCES `DELIVERABLE` (`DELIVERABLE_ID`),
  CONSTRAINT `WKEFF_DELPRD_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 `WORK_EFFORT_EVENT_REMINDER`
--

DROP TABLE IF EXISTS `WORK_EFFORT_EVENT_REMINDER`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `WORK_EFFORT_EVENT_REMINDER` (
  `WORK_EFFORT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `SEQUENCE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `CONTACT_MECH_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `PARTY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `REMINDER_DATE_TIME` datetime DEFAULT NULL,
  `REPEAT_COUNT` decimal(20,0) DEFAULT NULL,
  `REPEAT_INTERVAL` decimal(20,0) DEFAULT NULL,
  `CURRENT_COUNT` decimal(20,0) DEFAULT NULL,
  `REMINDER_OFFSET` decimal(20,0) DEFAULT NULL,
  `LOCALE_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `TIME_ZONE_ID` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`WORK_EFFORT_ID`,`SEQUENCE_ID`),
  KEY `WE_EVENT_REMIND_WE` (`WORK_EFFORT_ID`),
  KEY `WE_EVENT_REMIND_CM` (`CONTACT_MECH_ID`),
  KEY `WE_EVENT_REMIND_PY` (`PARTY_ID`),
  CONSTRAINT `WE_EVENT_REMIND_CM` FOREIGN KEY (`CONTACT_MECH_ID`) REFERENCES `CONTACT_MECH` (`CONTACT_MECH_ID`),
  CONSTRAINT `WE_EVENT_REMIND_PY` FOREIGN KEY (`PARTY_ID`) REFERENCES `PARTY` (`PARTY_ID`),
  CONSTRAINT `WE_EVENT_REMIND_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 `WORK_EFFORT_FIXED_ASSET_ASSIGN`
--

DROP TABLE IF EXISTS `WORK_EFFORT_FIXED_ASSET_ASSIGN`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `WORK_EFFORT_FIXED_ASSET_ASSIGN` (
  `WORK_EFFORT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FIXED_ASSET_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `STATUS_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `FROM_DATE` datetime NOT NULL,
  `THRU_DATE` datetime DEFAULT NULL,
  `AVAILABILITY_STATUS_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `ALLOCATED_COST` decimal(18,2) DEFAULT NULL,
  `COMMENTS` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`WORK_EFFORT_ID`,`FIXED_ASSET_ID`,`FROM_DATE`),
  KEY `WKEFF_FXDAA_WEFF` (`WORK_EFFORT_ID`),
  KEY `WKEFF_FXDAA_FXAS` (`FIXED_ASSET_ID`),
  KEY `WKEFF_FXDAA_STTS` (`STATUS_ID`),
  KEY `WKEFF_FXDAA_AVAIL` (`AVAILABILITY_STATUS_ID`),
  CONSTRAINT `WKEFF_FXDAA_AVAIL` FOREIGN KEY (`AVAILABILITY_STATUS_ID`) REFERENCES `STATUS_ITEM` (`STATUS_ID`),
  CONSTRAINT `WKEFF_FXDAA_FXAS` FOREIGN KEY (`FIXED_ASSET_ID`) REFERENCES `FIXED_ASSET` (`FIXED_ASSET_ID`),
  CONSTRAINT `WKEFF_FXDAA_STTS` FOREIGN KEY (`STATUS_ID`) REFERENCES `STATUS_ITEM` (`STATUS_ID`),
  CONSTRAINT `WKEFF_FXDAA_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 `WORK_EFFORT_FIXED_ASSET_STD`
--

DROP TABLE IF EXISTS `WORK_EFFORT_FIXED_ASSET_STD`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `WORK_EFFORT_FIXED_ASSET_STD` (
  `WORK_EFFORT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `FIXED_ASSET_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ESTIMATED_QUANTITY` double DEFAULT NULL,
  `ESTIMATED_DURATION` double DEFAULT NULL,
  `ESTIMATED_COST` decimal(18,2) DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`WORK_EFFORT_ID`,`FIXED_ASSET_TYPE_ID`),
  KEY `WKEFF_FASTD_WEFF` (`WORK_EFFORT_ID`),
  KEY `WKEFF_FASTD_FAT` (`FIXED_ASSET_TYPE_ID`),
  CONSTRAINT `WKEFF_FASTD_FAT` FOREIGN KEY (`FIXED_ASSET_TYPE_ID`) REFERENCES `FIXED_ASSET_TYPE` (`FIXED_ASSET_TYPE_ID`),
  CONSTRAINT `WKEFF_FASTD_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 `WORK_EFFORT_GOOD_STANDARD`
--

DROP TABLE IF EXISTS `WORK_EFFORT_GOOD_STANDARD`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `WORK_EFFORT_GOOD_STANDARD` (
  `WORK_EFFORT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `PRODUCT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `WORK_EFFORT_GOOD_STD_TYPE_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,
  `ESTIMATED_QUANTITY` double DEFAULT NULL,
  `ESTIMATED_COST` decimal(18,2) DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`WORK_EFFORT_ID`,`PRODUCT_ID`,`WORK_EFFORT_GOOD_STD_TYPE_ID`,`FROM_DATE`),
  KEY `WKEFF_GDSTD_WEFF` (`WORK_EFFORT_ID`),
  KEY `WKEFF_GDSTD_TYPE` (`WORK_EFFORT_GOOD_STD_TYPE_ID`),
  KEY `WKEFF_GDSTD_PROD` (`PRODUCT_ID`),
  KEY `WKEFF_GDSTD_STTS` (`STATUS_ID`),
  CONSTRAINT `WKEFF_GDSTD_PROD` FOREIGN KEY (`PRODUCT_ID`) REFERENCES `PRODUCT` (`PRODUCT_ID`),
  CONSTRAINT `WKEFF_GDSTD_STTS` FOREIGN KEY (`STATUS_ID`) REFERENCES `STATUS_ITEM` (`STATUS_ID`),
  CONSTRAINT `WKEFF_GDSTD_TYPE` FOREIGN KEY (`WORK_EFFORT_GOOD_STD_TYPE_ID`) REFERENCES `WORK_EFFORT_GOOD_STANDARD_TYPE` (`WORK_EFFORT_GOOD_STD_TYPE_ID`),
  CONSTRAINT `WKEFF_GDSTD_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 `WORK_EFFORT_GOOD_STANDARD_TYPE`
--

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

--
-- Table structure for table `WORK_EFFORT_ICAL_DATA`
--

DROP TABLE IF EXISTS `WORK_EFFORT_ICAL_DATA`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `WORK_EFFORT_ICAL_DATA` (
  `WORK_EFFORT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ICAL_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 (`WORK_EFFORT_ID`),
  KEY `WKEFF_ICAL_DATA` (`WORK_EFFORT_ID`),
  CONSTRAINT `WKEFF_ICAL_DATA` 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 `WORK_EFFORT_INVENTORY_ASSIGN`
--

DROP TABLE IF EXISTS `WORK_EFFORT_INVENTORY_ASSIGN`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `WORK_EFFORT_INVENTORY_ASSIGN` (
  `WORK_EFFORT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `INVENTORY_ITEM_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `STATUS_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `QUANTITY` 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 (`WORK_EFFORT_ID`,`INVENTORY_ITEM_ID`),
  KEY `WKEFF_INVAS_WEFF` (`WORK_EFFORT_ID`),
  KEY `WKEFF_INVAS_INVIT` (`INVENTORY_ITEM_ID`),
  KEY `WKEFF_INVAS_STTS` (`STATUS_ID`),
  CONSTRAINT `WKEFF_INVAS_INVIT` FOREIGN KEY (`INVENTORY_ITEM_ID`) REFERENCES `INVENTORY_ITEM` (`INVENTORY_ITEM_ID`),
  CONSTRAINT `WKEFF_INVAS_STTS` FOREIGN KEY (`STATUS_ID`) REFERENCES `STATUS_ITEM` (`STATUS_ID`),
  CONSTRAINT `WKEFF_INVAS_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 `WORK_EFFORT_INVENTORY_PRODUCED`
--

DROP TABLE IF EXISTS `WORK_EFFORT_INVENTORY_PRODUCED`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `WORK_EFFORT_INVENTORY_PRODUCED` (
  `WORK_EFFORT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `INVENTORY_ITEM_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 (`WORK_EFFORT_ID`,`INVENTORY_ITEM_ID`),
  KEY `WKEFF_INVPD_WEFF` (`WORK_EFFORT_ID`),
  KEY `WKEFF_INVPD_INVIT` (`INVENTORY_ITEM_ID`),
  CONSTRAINT `WKEFF_INVPD_INVIT` FOREIGN KEY (`INVENTORY_ITEM_ID`) REFERENCES `INVENTORY_ITEM` (`INVENTORY_ITEM_ID`),
  CONSTRAINT `WKEFF_INVPD_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 `WORK_EFFORT_KEYWORD`
--

DROP TABLE IF EXISTS `WORK_EFFORT_KEYWORD`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `WORK_EFFORT_KEYWORD` (
  `WORK_EFFORT_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 (`WORK_EFFORT_ID`,`KEYWORD`),
  KEY `WEFF_KWD_WEFF` (`WORK_EFFORT_ID`),
  CONSTRAINT `WEFF_KWD_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 `WORK_EFFORT_NOTE`
--

DROP TABLE IF EXISTS `WORK_EFFORT_NOTE`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `WORK_EFFORT_NOTE` (
  `WORK_EFFORT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `NOTE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `INTERNAL_NOTE` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`WORK_EFFORT_ID`,`NOTE_ID`),
  KEY `WKEFF_NTE_WEFF` (`WORK_EFFORT_ID`),
  KEY `WKEFF_NTE_NOTE` (`NOTE_ID`),
  CONSTRAINT `WKEFF_NTE_NOTE` FOREIGN KEY (`NOTE_ID`) REFERENCES `NOTE_DATA` (`NOTE_ID`),
  CONSTRAINT `WKEFF_NTE_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 `WORK_EFFORT_PARTY_ASSIGNMENT`
--

DROP TABLE IF EXISTS `WORK_EFFORT_PARTY_ASSIGNMENT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `WORK_EFFORT_PARTY_ASSIGNMENT` (
  `WORK_EFFORT_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,
  `ASSIGNED_BY_USER_LOGIN_ID` varchar(250) COLLATE latin1_general_cs DEFAULT NULL,
  `STATUS_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `STATUS_DATE_TIME` datetime DEFAULT NULL,
  `EXPECTATION_ENUM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `DELEGATE_REASON_ENUM_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `FACILITY_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `COMMENTS` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `MUST_RSVP` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `AVAILABILITY_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 (`WORK_EFFORT_ID`,`PARTY_ID`,`ROLE_TYPE_ID`,`FROM_DATE`),
  KEY `WKEFF_PA_WE` (`WORK_EFFORT_ID`),
  KEY `WKEFF_PA_ABUSRLOG` (`ASSIGNED_BY_USER_LOGIN_ID`),
  KEY `WKEFF_PA_STTS` (`STATUS_ID`),
  KEY `WKEFF_PA_EXP_ENUM` (`EXPECTATION_ENUM_ID`),
  KEY `WKEFF_PA_DELR_ENM` (`DELEGATE_REASON_ENUM_ID`),
  KEY `WKEFF_PA_FACILITY` (`FACILITY_ID`),
  KEY `WKEFF_PA_AVSTTS` (`AVAILABILITY_STATUS_ID`),
  CONSTRAINT `WKEFF_PA_ABUSRLOG` FOREIGN KEY (`ASSIGNED_BY_USER_LOGIN_ID`) REFERENCES `USER_LOGIN` (`USER_LOGIN_ID`),
  CONSTRAINT `WKEFF_PA_AVSTTS` FOREIGN KEY (`AVAILABILITY_STATUS_ID`) REFERENCES `STATUS_ITEM` (`STATUS_ID`),
  CONSTRAINT `WKEFF_PA_DELR_ENM` FOREIGN KEY (`DELEGATE_REASON_ENUM_ID`) REFERENCES `ENUMERATION` (`ENUM_ID`),
  CONSTRAINT `WKEFF_PA_EXP_ENUM` FOREIGN KEY (`EXPECTATION_ENUM_ID`) REFERENCES `ENUMERATION` (`ENUM_ID`),
  CONSTRAINT `WKEFF_PA_FACILITY` FOREIGN KEY (`FACILITY_ID`) REFERENCES `FACILITY` (`FACILITY_ID`),
  CONSTRAINT `WKEFF_PA_STTS` FOREIGN KEY (`STATUS_ID`) REFERENCES `STATUS_ITEM` (`STATUS_ID`),
  CONSTRAINT `WKEFF_PA_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 `WORK_EFFORT_PURPOSE_TYPE`
--

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

--
-- Table structure for table `WORK_EFFORT_REVIEW`
--

DROP TABLE IF EXISTS `WORK_EFFORT_REVIEW`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `WORK_EFFORT_REVIEW` (
  `WORK_EFFORT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `USER_LOGIN_ID` varchar(250) COLLATE latin1_general_cs NOT NULL,
  `REVIEW_DATE` datetime NOT NULL,
  `STATUS_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `POSTED_ANONYMOUS` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `RATING` double DEFAULT NULL,
  `REVIEW_TEXT` longtext COLLATE latin1_general_cs,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`WORK_EFFORT_ID`,`USER_LOGIN_ID`,`REVIEW_DATE`),
  KEY `WEFF_REVIEW_WEFF` (`WORK_EFFORT_ID`),
  KEY `WEFF_REVIEW_UL` (`USER_LOGIN_ID`),
  KEY `WEFF_REVIEW_STTS` (`STATUS_ID`),
  CONSTRAINT `WEFF_REVIEW_STTS` FOREIGN KEY (`STATUS_ID`) REFERENCES `STATUS_ITEM` (`STATUS_ID`),
  CONSTRAINT `WEFF_REVIEW_UL` FOREIGN KEY (`USER_LOGIN_ID`) REFERENCES `USER_LOGIN` (`USER_LOGIN_ID`),
  CONSTRAINT `WEFF_REVIEW_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 `WORK_EFFORT_SEARCH_CONSTRAINT`
--

DROP TABLE IF EXISTS `WORK_EFFORT_SEARCH_CONSTRAINT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `WORK_EFFORT_SEARCH_CONSTRAINT` (
  `WORK_EFFORT_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_WORK_EFFORTS` 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 (`WORK_EFFORT_SEARCH_RESULT_ID`,`CONSTRAINT_SEQ_ID`),
  KEY `WEFF_SCHRSI_RES` (`WORK_EFFORT_SEARCH_RESULT_ID`),
  CONSTRAINT `WEFF_SCHRSI_RES` FOREIGN KEY (`WORK_EFFORT_SEARCH_RESULT_ID`) REFERENCES `WORK_EFFORT_SEARCH_RESULT` (`WORK_EFFORT_SEARCH_RESULT_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `WORK_EFFORT_SEARCH_RESULT`
--

DROP TABLE IF EXISTS `WORK_EFFORT_SEARCH_RESULT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `WORK_EFFORT_SEARCH_RESULT` (
  `WORK_EFFORT_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 (`WORK_EFFORT_SEARCH_RESULT_ID`),
  KEY `WEFF_SCHRES_VST` (`VISIT_ID`),
  CONSTRAINT `WEFF_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 `WORK_EFFORT_SKILL_STANDARD`
--

DROP TABLE IF EXISTS `WORK_EFFORT_SKILL_STANDARD`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `WORK_EFFORT_SKILL_STANDARD` (
  `WORK_EFFORT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `SKILL_TYPE_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ESTIMATED_NUM_PEOPLE` double DEFAULT NULL,
  `ESTIMATED_DURATION` double DEFAULT NULL,
  `ESTIMATED_COST` decimal(18,2) DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`WORK_EFFORT_ID`,`SKILL_TYPE_ID`),
  KEY `WKEFF_SKLSTD_WEFF` (`WORK_EFFORT_ID`),
  KEY `WKEFF_SKLSTD_SKTP` (`SKILL_TYPE_ID`),
  CONSTRAINT `WKEFF_SKLSTD_SKTP` FOREIGN KEY (`SKILL_TYPE_ID`) REFERENCES `SKILL_TYPE` (`SKILL_TYPE_ID`),
  CONSTRAINT `WKEFF_SKLSTD_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 `WORK_EFFORT_STATUS`
--

DROP TABLE IF EXISTS `WORK_EFFORT_STATUS`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `WORK_EFFORT_STATUS` (
  `WORK_EFFORT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `STATUS_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `STATUS_DATETIME` datetime NOT NULL,
  `SET_BY_USER_LOGIN` varchar(250) COLLATE latin1_general_cs DEFAULT NULL,
  `REASON` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`WORK_EFFORT_ID`,`STATUS_ID`,`STATUS_DATETIME`),
  KEY `WKEFF_STTS_WE` (`WORK_EFFORT_ID`),
  KEY `WKEFF_STTS_STTS` (`STATUS_ID`),
  KEY `WKEFF_STTS_SB_UL` (`SET_BY_USER_LOGIN`),
  CONSTRAINT `WKEFF_STTS_SB_UL` FOREIGN KEY (`SET_BY_USER_LOGIN`) REFERENCES `USER_LOGIN` (`USER_LOGIN_ID`),
  CONSTRAINT `WKEFF_STTS_STTS` FOREIGN KEY (`STATUS_ID`) REFERENCES `STATUS_ITEM` (`STATUS_ID`),
  CONSTRAINT `WKEFF_STTS_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 `WORK_EFFORT_SURVEY_APPL`
--

DROP TABLE IF EXISTS `WORK_EFFORT_SURVEY_APPL`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `WORK_EFFORT_SURVEY_APPL` (
  `WORK_EFFORT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `SURVEY_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 (`WORK_EFFORT_ID`,`SURVEY_ID`,`FROM_DATE`),
  KEY `WKEF_SURVAPL_SVY` (`SURVEY_ID`),
  KEY `WKEF_SURVAPL_WKE` (`WORK_EFFORT_ID`),
  KEY `WKEF_SURVAPL_PSSA` (`SURVEY_ID`),
  CONSTRAINT `WKEF_SURVAPL_PSSA` FOREIGN KEY (`SURVEY_ID`) REFERENCES `PRODUCT_STORE_SURVEY_APPL` (`PRODUCT_STORE_SURVEY_ID`),
  CONSTRAINT `WKEF_SURVAPL_SVY` FOREIGN KEY (`SURVEY_ID`) REFERENCES `SURVEY` (`SURVEY_ID`),
  CONSTRAINT `WKEF_SURVAPL_WKE` 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 `WORK_EFFORT_TRANS_BOX`
--

DROP TABLE IF EXISTS `WORK_EFFORT_TRANS_BOX`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `WORK_EFFORT_TRANS_BOX` (
  `PROCESS_WORK_EFFORT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `TO_ACTIVITY_ID` varchar(60) COLLATE latin1_general_cs NOT NULL,
  `TRANSITION_ID` 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 (`PROCESS_WORK_EFFORT_ID`,`TO_ACTIVITY_ID`,`TRANSITION_ID`),
  KEY `WKEFF_TXBX_WE` (`PROCESS_WORK_EFFORT_ID`),
  CONSTRAINT `WKEFF_TXBX_WE` FOREIGN KEY (`PROCESS_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 `WORK_EFFORT_TYPE`
--

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

--
-- Table structure for table `WORK_EFFORT_TYPE_ATTR`
--

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

--
-- Table structure for table `WORK_ORDER_ITEM_FULFILLMENT`
--

DROP TABLE IF EXISTS `WORK_ORDER_ITEM_FULFILLMENT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `WORK_ORDER_ITEM_FULFILLMENT` (
  `WORK_EFFORT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ORDER_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `ORDER_ITEM_SEQ_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `SHIP_GROUP_SEQ_ID` varchar(20) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_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`,`ORDER_ID`,`ORDER_ITEM_SEQ_ID`),
  KEY `WORDER_ITFMT_OHDR` (`ORDER_ID`),
  KEY `WORDER_ITFMT_OITM` (`ORDER_ID`,`ORDER_ITEM_SEQ_ID`),
  KEY `WORDER_ITFMT_WEFRT` (`WORK_EFFORT_ID`),
  CONSTRAINT `WORDER_ITFMT_OHDR` FOREIGN KEY (`ORDER_ID`) REFERENCES `ORDER_HEADER` (`ORDER_ID`),
  CONSTRAINT `WORDER_ITFMT_OITM` FOREIGN KEY (`ORDER_ID`, `ORDER_ITEM_SEQ_ID`) REFERENCES `ORDER_ITEM` (`ORDER_ID`, `ORDER_ITEM_SEQ_ID`),
  CONSTRAINT `WORDER_ITFMT_WEFRT` 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 `WORK_REQUIREMENT_FULFILLMENT`
--

DROP TABLE IF EXISTS `WORK_REQUIREMENT_FULFILLMENT`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `WORK_REQUIREMENT_FULFILLMENT` (
  `REQUIREMENT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `WORK_EFFORT_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `WORK_REQ_FULF_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 (`REQUIREMENT_ID`,`WORK_EFFORT_ID`),
  KEY `WORK_REQFL_REQ` (`REQUIREMENT_ID`),
  KEY `WORK_REQFL_WEFF` (`WORK_EFFORT_ID`),
  KEY `WORK_REQFL_WRFT` (`WORK_REQ_FULF_TYPE_ID`),
  CONSTRAINT `WORK_REQFL_REQ` FOREIGN KEY (`REQUIREMENT_ID`) REFERENCES `REQUIREMENT` (`REQUIREMENT_ID`),
  CONSTRAINT `WORK_REQFL_WEFF` FOREIGN KEY (`WORK_EFFORT_ID`) REFERENCES `WORK_EFFORT` (`WORK_EFFORT_ID`),
  CONSTRAINT `WORK_REQFL_WRFT` FOREIGN KEY (`WORK_REQ_FULF_TYPE_ID`) REFERENCES `WORK_REQ_FULF_TYPE` (`WORK_REQ_FULF_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `WORK_REQ_FULF_TYPE`
--

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

--
-- Table structure for table `X509_ISSUER_PROVISION`
--

DROP TABLE IF EXISTS `X509_ISSUER_PROVISION`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `X509_ISSUER_PROVISION` (
  `CERT_PROVISION_ID` varchar(20) COLLATE latin1_general_cs NOT NULL,
  `COMMON_NAME` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `ORGANIZATIONAL_UNIT` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `ORGANIZATION_NAME` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `CITY_LOCALITY` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `STATE_PROVINCE` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `COUNTRY` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `SERIAL_NUMBER` varchar(255) COLLATE latin1_general_cs DEFAULT NULL,
  `LAST_UPDATED_STAMP` datetime DEFAULT NULL,
  `LAST_UPDATED_TX_STAMP` datetime DEFAULT NULL,
  `CREATED_STAMP` datetime DEFAULT NULL,
  `CREATED_TX_STAMP` datetime DEFAULT NULL,
  PRIMARY KEY (`CERT_PROVISION_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ZIP_SALES_RULE_LOOKUP`
--

DROP TABLE IF EXISTS `ZIP_SALES_RULE_LOOKUP`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ZIP_SALES_RULE_LOOKUP` (
  `STATE_CODE` varchar(60) COLLATE latin1_general_cs NOT NULL,
  `CITY` varchar(60) COLLATE latin1_general_cs NOT NULL,
  `COUNTY` varchar(60) COLLATE latin1_general_cs NOT NULL,
  `FROM_DATE` datetime NOT NULL,
  `ID_CODE` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `TAXABLE` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `SHIP_COND` 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 (`STATE_CODE`,`CITY`,`COUNTY`,`FROM_DATE`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ZIP_SALES_TAX_LOOKUP`
--

DROP TABLE IF EXISTS `ZIP_SALES_TAX_LOOKUP`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ZIP_SALES_TAX_LOOKUP` (
  `ZIP_CODE` varchar(60) COLLATE latin1_general_cs NOT NULL,
  `STATE_CODE` varchar(60) COLLATE latin1_general_cs NOT NULL,
  `CITY` varchar(60) COLLATE latin1_general_cs NOT NULL,
  `COUNTY` varchar(60) COLLATE latin1_general_cs NOT NULL,
  `FROM_DATE` datetime NOT NULL,
  `COUNTY_FIPS` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `COUNTY_DEFAULT` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `GENERAL_DEFAULT` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `INSIDE_CITY` char(1) COLLATE latin1_general_cs DEFAULT NULL,
  `GEO_CODE` varchar(60) COLLATE latin1_general_cs DEFAULT NULL,
  `STATE_SALES_TAX` decimal(18,6) DEFAULT NULL,
  `CITY_SALES_TAX` decimal(18,6) DEFAULT NULL,
  `CITY_LOCAL_SALES_TAX` decimal(18,6) DEFAULT NULL,
  `COUNTY_SALES_TAX` decimal(18,6) DEFAULT NULL,
  `COUNTY_LOCAL_SALES_TAX` decimal(18,6) DEFAULT NULL,
  `COMBO_SALES_TAX` decimal(18,6) DEFAULT NULL,
  `STATE_USE_TAX` decimal(18,6) DEFAULT NULL,
  `CITY_USE_TAX` decimal(18,6) DEFAULT NULL,
  `CITY_LOCAL_USE_TAX` decimal(18,6) DEFAULT NULL,
  `COUNTY_USE_TAX` decimal(18,6) DEFAULT NULL,
  `COUNTY_LOCAL_USE_TAX` decimal(18,6) DEFAULT NULL,
  `COMBO_USE_TAX` 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 (`ZIP_CODE`,`STATE_CODE`,`CITY`,`COUNTY`,`FROM_DATE`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2015-06-05 17:26:07
