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

CREATE TABLE IDN_CORS_ASSOCIATION (
    IDN_CORS_ORIGIN_ID  INT NOT NULL,
    SP_APP_ID           INT NOT NULL,

    PRIMARY KEY (IDN_CORS_ORIGIN_ID, SP_APP_ID),
    FOREIGN KEY (IDN_CORS_ORIGIN_ID) REFERENCES IDN_CORS_ORIGIN (ID) ON DELETE CASCADE,
    FOREIGN KEY (SP_APP_ID) REFERENCES SP_APP (ID) ON DELETE CASCADE

    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),
