CREATE TABLE BLC_APPLICATION (ID VARCHAR2(36 CHAR) NOT NULL, ALLOWED_CURRENCIES CLOB, ALLOWED_LOCALES CLOB, DEACTIVATED CHAR(1 CHAR) DEFAULT 'N' NOT NULL, DEFAULT_CURRENCY VARCHAR2(255 CHAR), DEFAULT_LOCALE VARCHAR2(255 CHAR), IDENTIFIER_TYPE VARCHAR2(60 CHAR), IDENTIFIER_VALUE VARCHAR2(255 CHAR), NAME VARCHAR2(255 CHAR), UPDATED_TIMESTAMP TIMESTAMP(6), TRK_ARCHIVED CHAR(1 CHAR) DEFAULT 'N' NOT NULL, TRK_CHANGE_DETAILS CLOB, TRK_TENANT_ID VARCHAR2(36 CHAR), CONSTRAINT CT_6ZOHIVNNSYELOKNI1LEE PRIMARY KEY (ID));
CREATE TABLE BLC_APPLICATION_CATALOG (APPLICATION_ID VARCHAR2(36 CHAR) NOT NULL, CATALOG_STATUS VARCHAR2(60 CHAR), CONTEXT_ID VARCHAR2(36 CHAR), EXCLUDE_FROM_ADD CHAR(1 CHAR) DEFAULT 'N' NOT NULL, IMPLICIT VARCHAR2(36 CHAR), MUTABILITY_TYPE VARCHAR2(60 CHAR), VISIBLE_AS_ASSIGNED CHAR(1 CHAR) DEFAULT 'Y' NOT NULL, ISOLATED_CATALOGS_ORDER NUMBER(10, 0) NOT NULL, CONSTRAINT CT_3QZYUEQYU3K1G1KZGUN5 PRIMARY KEY (APPLICATION_ID, ISOLATED_CATALOGS_ORDER));
CREATE TABLE BLC_CATALOG (ID VARCHAR2(36 CHAR) NOT NULL, DEFAULT_CURRENCY VARCHAR2(255 CHAR), HIDDEN CHAR(1 CHAR) DEFAULT 'N' NOT NULL, CATALOG_LEVEL NUMBER(19, 0), CATALOG_LOCALE VARCHAR2(255 CHAR), CATALOG_NAME VARCHAR2(255 CHAR), OWNING_APPLICATION VARCHAR2(36 CHAR), UPDATED_TIMESTAMP TIMESTAMP(6), TRK_ARCHIVED CHAR(1 CHAR) DEFAULT 'N' NOT NULL, TRK_CHANGE_DETAILS CLOB, TRK_TENANT_ID VARCHAR2(36 CHAR), VENDOR_REF VARCHAR2(255 CHAR), CONSTRAINT CT_CQ8NUUXYU9BKH4Q6ESQ7 PRIMARY KEY (ID));
CREATE TABLE BLC_CATALOG_REF (ID VARCHAR2(36 CHAR) NOT NULL, EXCLUSION_FILTERS CLOB, INCLUSION_FILTERS CLOB, MUTABILITY_TYPE VARCHAR2(60 CHAR), PARENT_CATALOG_ID VARCHAR2(36 CHAR), CHILD_CATALOG_ID VARCHAR2(36 CHAR) NOT NULL, PARENTS_ORDER NUMBER(10, 0), CONSTRAINT CT_CGUEJMGMI2D8JP6PU5XE PRIMARY KEY (ID));
CREATE TABLE BLC_CHANGE_DEPLOY (ID VARCHAR2(36 CHAR) NOT NULL, APPLICATION VARCHAR2(36 CHAR), ARCHIVED CHAR(1 CHAR) DEFAULT 'N' NOT NULL, AUTHOR VARCHAR2(255 CHAR), GROUP_IDS CLOB, DATE_CREATED TIMESTAMP(6), DATE_SCHEDULED TIMESTAMP(6), DEPLOY_MESSAGE VARCHAR2(255 CHAR), DISPLAY_NAME VARCHAR2(255 CHAR), DEPLOY_EXCEPTION CLOB, TRACKING_LEVEL NUMBER(10, 0), SANDBOX VARCHAR2(36 CHAR), STATE VARCHAR2(60 CHAR), STATUS VARCHAR2(60 CHAR), STATUS_CHANGE_TIME TIMESTAMP(6), CONSTRAINT CT_1SK0F18G138BAR1YHKSQ PRIMARY KEY (ID));
CREATE TABLE BLC_CHANGE_SUMMARY (ID VARCHAR2(36 CHAR) NOT NULL, ARCHIVED CHAR(1 CHAR) DEFAULT 'N' NOT NULL, AUTHOR VARCHAR2(60 CHAR), TRK_CHANGE_DETAILS CLOB, TRK_FIELD_OVERRIDES CLOB, TRK_MAX_FIELD_VERSIONS CLOB, TRK_APPLICATION_CONTEXT_ID VARCHAR2(36 CHAR), TRK_APPLICATION_DEFAULT_LOCALE VARCHAR2(255 CHAR), TRK_APPLICATION_NAME VARCHAR2(255 CHAR), TRK_ARCHIVED CHAR(1 CHAR) DEFAULT 'N' NOT NULL, TRK_CATALOG_CONTEXT_ID VARCHAR2(36 CHAR), TRK_CATALOG_LEVEL NUMBER(19, 0), TRK_CATALOG_LOCALE VARCHAR2(255 CHAR), TRK_CATALOG_NAME VARCHAR2(255 CHAR), TRK_PARENT_CAT_CONTEXT_ID VARCHAR2(36 CHAR), TRK_PARENT_CAT_LEVEL NUMBER(19, 0), TRK_PARENT_CAT_LOCALE VARCHAR2(255 CHAR), TRK_PARENT_CAT_NAME VARCHAR2(255 CHAR), TRK_CREATING_APPLICATION_ID VARCHAR2(36 CHAR), TRK_CURRENT_MESSAGE VARCHAR2(255 CHAR), TRK_LEVEL NUMBER(10, 0), TRK_SANDBOX_ARCHIVED CHAR(1 CHAR) DEFAULT 'N' NOT NULL, TRK_SUB_CONTAINER_CATALOG VARCHAR2(36 CHAR), TRK_CHANGE_CONTAINER_ID VARCHAR2(36 CHAR), TRK_CHANGE_CONTAINER_NAME VARCHAR2(255 CHAR), TRK_CHANGE_CONTAINER_ROUTE_KEY VARCHAR2(60 CHAR), TRK_SUB_CONTAINER_NAME VARCHAR2(255 CHAR), TRK_SANDBOX_CHANGE_TYPE VARCHAR2(60 CHAR), TRK_SANDBOX_CONTEXT_ID VARCHAR2(36 CHAR), TRK_SANDBOX_NAME VARCHAR2(255 CHAR), TRK_SANDBOX_OWNER VARCHAR2(60 CHAR), TRK_SANDBOX_STAGE VARCHAR2(60 CHAR), TRK_TENANT_ID VARCHAR2(36 CHAR), DISPLAY_NAME VARCHAR2(255 CHAR), DOMAIN_ALIAS VARCHAR2(60 CHAR), DOMAIN_CONTEXT_ID VARCHAR2(36 CHAR), ENTITY_TYPE VARCHAR2(255 CHAR), TRANSITION_EXCEPTION CLOB, INDEXABLE_PROCESSED CHAR(1 CHAR) DEFAULT 'N' NOT NULL, INDEXABLE_TARGET_ID VARCHAR2(36 CHAR), INDEXABLE_TYPE VARCHAR2(60 CHAR), PROMOTION_ID VARCHAR2(36 CHAR), REJECT_MESSAGE VARCHAR2(255 CHAR), SANDBOX VARCHAR2(36 CHAR), STATE VARCHAR2(60 CHAR), STATUS VARCHAR2(60 CHAR), STATUS_CHANGE_TIME TIMESTAMP(6), CONSTRAINT CT_RMPU1U33KIL9YSFU53QH PRIMARY KEY (ID));
CREATE TABLE BLC_CHANGE_SUMMARY_GROUP (ID VARCHAR2(36 CHAR) NOT NULL, ARCHIVED CHAR(1 CHAR) DEFAULT 'N' NOT NULL, AUTHOR VARCHAR2(255 CHAR), SUMMARY_IDS CLOB, DEPLOYMENT_DATE TIMESTAMP(6), DISPLAY_NAME VARCHAR2(255 CHAR), TRANSITION_EXCEPTION CLOB, PROMOTE_MESSAGE VARCHAR2(255 CHAR), SANDBOX VARCHAR2(36 CHAR), STATE VARCHAR2(60 CHAR), STATUS VARCHAR2(60 CHAR), CHANGE_STATUS_TIME TIMESTAMP(6), CONSTRAINT CT_Q4XY1G65MQVC0Z7M9FC5 PRIMARY KEY (ID));
CREATE TABLE BLC_NOTIFICATION_STATE (ID VARCHAR2(36 CHAR) NOT NULL, ACKED CHAR(1 CHAR) DEFAULT 'N' NOT NULL, ATTEMPTS NUMBER(10, 0), CHANGE_TIMESTAMP TIMESTAMP(6), CHANGE_TIMESTAMP_ACK TIMESTAMP(6), CONTAINER VARCHAR2(36 CHAR), ENTITY_TYPE VARCHAR2(255 CHAR) NOT NULL, MESSAGE_TYPE VARCHAR2(255 CHAR), MESSAGE_VALUE CLOB, NOTIFICATION_NAME VARCHAR2(255 CHAR), NEXT_ATTEMPT TIMESTAMP(6), STOPPED CHAR(1 CHAR) DEFAULT 'N' NOT NULL, CONSTRAINT CT_ZI4JZDGR73K579DWFA21 PRIMARY KEY (ID));
CREATE TABLE BLC_RESOURCE_LOCK (ID VARCHAR2(36 CHAR) NOT NULL, CONCEPT_KEY VARCHAR2(255 CHAR), CONTEXT_ID VARCHAR2(36 CHAR), LOCK_EXPIRATION_TIMESTAMP TIMESTAMP(6), LOCKED CHAR(1 CHAR) DEFAULT 'N', SANDBOX_ID VARCHAR2(36 CHAR), LOCK_TIMESTAMP TIMESTAMP(6), TOKEN VARCHAR2(255 CHAR), TYPE_ALIAS VARCHAR2(255 CHAR), CONSTRAINT CT_D9E6HPF8SOPN8UBZZSIY PRIMARY KEY (ID));
CREATE TABLE BLC_SANDBOX (ID VARCHAR2(36 CHAR) NOT NULL, APPLICATION VARCHAR2(36 CHAR), COLOR VARCHAR2(255 CHAR), DESCRIPTION VARCHAR2(255 CHAR), NAME VARCHAR2(255 CHAR), TRK_ARCHIVED CHAR(1 CHAR) DEFAULT 'N' NOT NULL, TRK_CHANGE_DETAILS CLOB, TRK_TENANT_ID VARCHAR2(36 CHAR), CONSTRAINT CT_FJN2YNCWLGDMGVGOL91N PRIMARY KEY (ID));
CREATE UNIQUE INDEX UK7IEGJT4GOJV24Q9BW8K0I4J0C ON BLC_RESOURCE_LOCK(CONTEXT_ID, TYPE_ALIAS, SANDBOX_ID, CONCEPT_KEY);
ALTER TABLE BLC_RESOURCE_LOCK ADD CONSTRAINT UK7IEGJT4GOJV24Q9BW8K0I4J0C UNIQUE (CONTEXT_ID, TYPE_ALIAS, SANDBOX_ID, CONCEPT_KEY) USING INDEX UK7IEGJT4GOJV24Q9BW8K0I4J0C;
CREATE INDEX FKQA2HUAJ7R3R8OVDILB9H71X2K_IDX ON BLC_CATALOG_REF(CHILD_CATALOG_ID);
CREATE INDEX IDX1FI9WNQ6EWRUBID3NPNNYQX8L ON BLC_SANDBOX(APPLICATION);
CREATE INDEX IDX4YHQVPE4G6RYVPWH87WSKV1RU ON BLC_CHANGE_SUMMARY_GROUP(SANDBOX, STATE);
CREATE INDEX IDX5PADHSPWPECYV5UB42YTUMELL ON BLC_CHANGE_SUMMARY(DOMAIN_CONTEXT_ID, DOMAIN_ALIAS, ENTITY_TYPE, AUTHOR, SANDBOX);
CREATE INDEX IDX7I0I5VCL1DKKWUQ5DYC88WEM5 ON BLC_NOTIFICATION_STATE(ACKED);
CREATE INDEX IDXF8YV5LWYF62IFCTB6H19B8KS8 ON BLC_SANDBOX(NAME);
CREATE INDEX IDXGFAQE3XMQ5Q4YH78MIX1G04FY ON BLC_NOTIFICATION_STATE(CONTAINER);
CREATE INDEX IDXH32LNE3IXBEPVH5RR6EEKPDQU ON BLC_CHANGE_SUMMARY(AUTHOR, SANDBOX);
CREATE INDEX IDXIHVG4SXHG7VY2WABGXXBW5HMS ON BLC_CHANGE_DEPLOY(APPLICATION, STATE);
CREATE INDEX IDXKM4Y3QJ3JH2MPT0RT6L6VSCL8 ON BLC_RESOURCE_LOCK(TOKEN);
CREATE INDEX IDXLJ2N3WDT6U930S8C5G28HH0YR ON BLC_APPLICATION_CATALOG(APPLICATION_ID);
CREATE INDEX IDXOSJ785TKEW6SXUW6SD26K70QK ON BLC_APPLICATION_CATALOG(CONTEXT_ID);
ALTER TABLE BLC_APPLICATION_CATALOG ADD CONSTRAINT FKDAEORQO87OH0RDU1LFKPV3QOW FOREIGN KEY (APPLICATION_ID) REFERENCES BLC_APPLICATION (ID);
ALTER TABLE BLC_CATALOG_REF ADD CONSTRAINT FKQA2HUAJ7R3R8OVDILB9H71X2K FOREIGN KEY (CHILD_CATALOG_ID) REFERENCES BLC_CATALOG (ID);
ALTER TABLE BLC_CHANGE_SUMMARY ADD TRANSITION_MARKER VARCHAR2(36 CHAR);
CREATE INDEX IDXN16C4RPNHKDT18CXE83YY6S9W ON BLC_CHANGE_SUMMARY(TRANSITION_MARKER);
ALTER TABLE BLC_CHANGE_SUMMARY ADD REMOVE_TEMP_OVERRIDE CHAR(1 CHAR) DEFAULT 'N' NOT NULL;
ALTER TABLE BLC_SANDBOX ADD TEMPORARY_SANDBOX CHAR(1 CHAR) DEFAULT 'N' NOT NULL;
CREATE INDEX IDX1SWM3W6CWNT8GVT8MAD3CTBQN ON BLC_CATALOG(OWNING_APPLICATION);
CREATE INDEX IDXO9YSROYX17NRB02MEF9QF3QJL ON BLC_CATALOG(VENDOR_REF);
CREATE TABLE BLC_CHANGE_DEPLOY_VENDOR_XREF (CHANGE_DEPLOY_ID VARCHAR2(255 CHAR) NOT NULL, VENDOR_REF VARCHAR2(255 CHAR) NOT NULL, CONSTRAINT CT_AURRIAYYU1I14CM2CJAB PRIMARY KEY (CHANGE_DEPLOY_ID, VENDOR_REF));
CREATE TABLE BLC_CHANGE_GROUP_VENDOR_XREF (CHANGE_GROUP_ID VARCHAR2(255 CHAR) NOT NULL, VENDOR_REF VARCHAR2(255 CHAR) NOT NULL, CONSTRAINT CT_DLEZVAC5L6RMUPK8OFI7 PRIMARY KEY (CHANGE_GROUP_ID, VENDOR_REF));
ALTER TABLE BLC_CHANGE_DEPLOY ADD AFFECTS_NON_VENDOR_DATA CHAR(1 CHAR) DEFAULT 'N' NOT NULL;
ALTER TABLE BLC_CHANGE_SUMMARY_GROUP ADD AFFECTS_NON_VENDOR_DATA CHAR(1 CHAR) DEFAULT 'N' NOT NULL;
ALTER TABLE BLC_CHANGE_SUMMARY ADD VENDOR_REF VARCHAR2(255 CHAR);
ALTER TABLE BLC_CHANGE_GROUP_VENDOR_XREF ADD CONSTRAINT FKIVHR0SDT80UUSIPVYIDW5BTB3 FOREIGN KEY (CHANGE_GROUP_ID) REFERENCES BLC_CHANGE_SUMMARY_GROUP (ID);
ALTER TABLE BLC_CHANGE_DEPLOY_VENDOR_XREF ADD CONSTRAINT FKPIB48X6689981WH37UM18G7MX FOREIGN KEY (CHANGE_DEPLOY_ID) REFERENCES BLC_CHANGE_DEPLOY (ID);
