             UNIQUE(IDP_USER_ID, TENANT_ID, IDP_ID),
             FOREIGN KEY (IDP_ID) REFERENCES IDP(ID) ON DELETE CASCADE)
 /
+
+CREATE SEQUENCE IDN_ASSOCIATED_ID_SEQ START WITH 1 INCREMENT BY 1 NOCACHE
+/
+CREATE TRIGGER IDN_ASSOCIATED_ID_TRIG NO CASCADE
+            BEFORE INSERT
+            ON IDN_ASSOCIATED_ID
+	    REFERENCING NEW AS NEW
+            FOR EACH ROW MODE DB2SQL
+                BEGIN ATOMIC
+                    SET (NEW.ID) = (NEXTVAL FOR IDN_ASSOCIATED_ID_SEQ);
+                END
+/
 CREATE TABLE IDN_USER_ACCOUNT_ASSOCIATION (
             ASSOCIATION_KEY VARCHAR(255) NOT NULL,
             TENANT_ID INTEGER NOT NULL,

CREATE INDEX IDX_AT_CK_AU ON IDN_OAUTH2_ACCESS_TOKEN(CONSUMER_KEY, AUTHZ_USER, TOKEN_STATE, USER_TYPE)
/
CREATE TABLE IDN_OAUTH2_SCOPE_ASSOCIATION (
            TOKEN_ID VARCHAR (255),
            TOKEN_SCOPE VARCHAR (60),
            PRIMARY KEY (TOKEN_ID, TOKEN_SCOPE),
            FOREIGN KEY (TOKEN_ID) REFERENCES IDN_OAUTH2_ACCESS_TOKEN(TOKEN_ID) ON DELETE CASCADE)
/

            PRIMARY KEY (SESSION_ID)
)
/

CREATE TABLE IDN_AUTH_SESSION_STORE (
           SESSION_ID VARCHAR (100) NOT NULL,
           SESSION_TYPE VARCHAR(100) NOT NULL,
           SESSION_OBJECT BLOB,
           TIME_CREATED TIMESTAMP,
           PRIMARY KEY (SESSION_ID, SESSION_TYPE)
)
/
CREATE TABLE SP_APP (
