 /
 
 CREATE TABLE WF_WORKFLOW_CONFIG_PARAM(
-    WORKFLOW_ID VARCHAR (45),
-    PARAM_NAME VARCHAR (45),
-    PARAM_VALUE VARCHAR (1000),
+    WORKFLOW_ID VARCHAR (45) NOT NULL,
+    PARAM_NAME VARCHAR (45) NOT NULL,
+    PARAM_VALUE VARCHAR (1000) NOT NULL,
     PRIMARY KEY (WORKFLOW_ID, PARAM_NAME),
     FOREIGN KEY (WORKFLOW_ID) REFERENCES WF_WORKFLOW(ID)ON DELETE CASCADE)
 /

/

CREATE TABLE WF_BPS_PROFILE (
    PROFILE_NAME VARCHAR(45),
    HOST_URL VARCHAR(45),
    USERNAME VARCHAR(45),
    PASSWORD VARCHAR(255),
    CALLBACK_HOST VARCHAR (45),
    CALLBACK_USERNAME VARCHAR (45),
    CALLBACK_PASSWORD VARCHAR (255),
    TENANT_ID VARCHAR (45),
    PRIMARY KEY (PROFILE_NAME, TENANT_ID))
/

CREATE TABLE WF_WORKFLOW(
    ID VARCHAR (45),
    WF_NAME VARCHAR (45),
    DESCRIPTION VARCHAR (255),
    TEMPLATE_ID VARCHAR (45),

            PRIMARY KEY (TOKEN_ID),
            FOREIGN KEY (CONSUMER_KEY_ID) REFERENCES IDN_OAUTH_CONSUMER_APPS(ID) ON DELETE CASCADE,
            CONSTRAINT CON_APP_KEY UNIQUE (CONSUMER_KEY_ID,AUTHZ_USER,TENANT_ID,USER_DOMAIN,USER_TYPE,TOKEN_SCOPE_HASH,
                                 TOKEN_STATE,TOKEN_STATE_ID))
/

CREATE INDEX IDX_AT_CK_AU ON IDN_OAUTH2_ACCESS_TOKEN(CONSUMER_KEY_ID, AUTHZ_USER, TOKEN_STATE, USER_TYPE)
