CREATE TABLE BLC_CREDIT_ACCOUNT (ID VARCHAR2(36 CHAR) NOT NULL, ACCOUNT_NUMBER VARCHAR2(60 CHAR), BALANCE NUMBER(19, 5), CURRENCY VARCHAR2(255 CHAR), OWNING_USER_REF VARCHAR2(60 CHAR), OWNING_USER_TYPE VARCHAR2(60 CHAR), TRK_ARCHIVED CHAR(1 CHAR) DEFAULT 'N' NOT NULL, AUDIT_CREATION_TIME TIMESTAMP(6), AUDIT_CREATOR VARCHAR2(60 CHAR), AUDIT_UPDATE_TIME TIMESTAMP(6), AUDIT_UPDATER VARCHAR2(60 CHAR), TRK_CHANGE_DETAILS CLOB, TRK_TENANT_ID VARCHAR2(36 CHAR), TYPE VARCHAR2(60 CHAR), CONSTRAINT CT_FLR61QR0LCK9HH31EERM 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_3TTO2CRK1UW79WMHGDJ9 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_416R07L0KF2TYE3UROW6 PRIMARY KEY (ID));
CREATE TABLE BLC_TRANSACTION (ID VARCHAR2(36 CHAR) NOT NULL, AMOUNT NUMBER(19, 5), DATE_RECORDED TIMESTAMP(6), REASON VARCHAR2(500 CHAR), REASON_DESCRIPTION CLOB, REQUEST_ID VARCHAR2(255 CHAR), SOURCE VARCHAR2(255 CHAR), SOURCE_ENTITY_ID VARCHAR2(36 CHAR), SOURCE_ENTITY_TYPE VARCHAR2(60 CHAR), SOURCE_USER_ID VARCHAR2(36 CHAR), SOURCE_USER_TYPE VARCHAR2(60 CHAR), TRK_ARCHIVED CHAR(1 CHAR) DEFAULT 'N' NOT NULL, AUDIT_CREATION_TIME TIMESTAMP(6), AUDIT_CREATOR VARCHAR2(60 CHAR), AUDIT_UPDATE_TIME TIMESTAMP(6), AUDIT_UPDATER VARCHAR2(60 CHAR), TRK_CHANGE_DETAILS CLOB, TRK_TENANT_ID VARCHAR2(36 CHAR), TRANSACTION_REFERENCE_ID VARCHAR2(255 CHAR), TYPE VARCHAR2(60 CHAR), CREDIT_ACCOUNT_ID VARCHAR2(36 CHAR) NOT NULL, CONSTRAINT CT_04RV7UIH4Y0Y09W0BWWQ PRIMARY KEY (ID));
ALTER TABLE BLC_RESOURCE_LOCK ADD CONSTRAINT UK7IEGJT4GOJV24Q9BW8K0I4J0C UNIQUE (CONTEXT_ID, TYPE_ALIAS, SANDBOX_ID, CONCEPT_KEY) USING INDEX UK7IEGJT4GOJV24Q9BW8K0I4J0C;
ALTER TABLE BLC_TRANSACTION ADD CONSTRAINT FKKPUCBCMXK6J1CI1DNPQJOSF9B FOREIGN KEY (CREDIT_ACCOUNT_ID) REFERENCES BLC_CREDIT_ACCOUNT (ID);
ALTER TABLE BLC_CREDIT_ACCOUNT ADD VERSION NUMBER(10, 0) NOT NULL;
