     TENANT_ID INTEGER DEFAULT -1 NOT NULL,
     SCOPE VARCHAR(255) NOT NULL,
     CONSENT NUMBER(1,0) DEFAULT 1 NOT NULL,
-
     PRIMARY KEY (ID),
     FOREIGN KEY (CONSENT_ID) REFERENCES IDN_OAUTH2_USER_CONSENT (CONSENT_ID) ON DELETE CASCADE,
     UNIQUE (CONSENT_ID, SCOPE)

    APP_ID CHAR(36) NOT NULL,
    TENANT_ID INTEGER DEFAULT -1 NOT NULL,
    CONSENT_ID VARCHAR(255) NOT NULL,

    PRIMARY KEY (ID),
    FOREIGN KEY (APP_ID) REFERENCES SP_APP (UUID) ON DELETE CASCADE,
    UNIQUE (USER_ID, APP_ID, TENANT_ID),

    TENANT_ID INTEGER       NOT NULL,
    ORIGIN    VARCHAR(2048) NOT NULL,
    UUID      CHAR(36)      NOT NULL,
    PRIMARY KEY (ID),
    UNIQUE (TENANT_ID, ORIGIN),
    UNIQUE (UUID)
