 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),
+            TOKEN_ID VARCHAR (255) NOT NULL,
+            TOKEN_SCOPE VARCHAR (60) NOT NULL,
             PRIMARY KEY (TOKEN_ID, TOKEN_SCOPE),
             FOREIGN KEY (TOKEN_ID) REFERENCES IDN_OAUTH2_ACCESS_TOKEN(TOKEN_ID) ON DELETE CASCADE)
 /

            PRIMARY KEY (TENANT_ID, DOMAIN_NAME, USER_NAME))
/
CREATE TABLE FIDO_DEVICE_STORE (
        TENANT_ID INTEGER,
        DOMAIN_NAME VARCHAR(255) NOT NULL,
        USER_NAME VARCHAR(45) NOT NULL,
	TIME_REGISTERED TIMESTAMP,

            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,
