|
|
|
@ -11,7 +11,7 @@ IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[I
|
|
|
|
|
CREATE TABLE IDN_OAUTH_CONSUMER_APPS (
|
|
|
|
|
ID INTEGER IDENTITY,
|
|
|
|
|
CONSUMER_KEY VARCHAR(255),
|
|
|
|
|
CONSUMER_SECRET VARCHAR(512),
|
|
|
|
|
CONSUMER_SECRET VARCHAR(2048),
|
|
|
|
|
USERNAME VARCHAR(255),
|
|
|
|
|
TENANT_ID INTEGER DEFAULT 0,
|
|
|
|
|
USER_DOMAIN VARCHAR(50),
|
|
|
|
@ -21,10 +21,22 @@ CREATE TABLE IDN_OAUTH_CONSUMER_APPS (
|
|
|
|
|
GRANT_TYPES VARCHAR(1024),
|
|
|
|
|
PKCE_MANDATORY CHAR(1) DEFAULT '0',
|
|
|
|
|
PKCE_SUPPORT_PLAIN CHAR(1) DEFAULT '0',
|
|
|
|
|
APP_STATE VARCHAR (25) DEFAULT 'ACTIVE',
|
|
|
|
|
USER_ACCESS_TOKEN_EXPIRE_TIME BIGINT DEFAULT 3600000,
|
|
|
|
|
APP_ACCESS_TOKEN_EXPIRE_TIME BIGINT DEFAULT 3600000,
|
|
|
|
|
REFRESH_TOKEN_EXPIRE_TIME BIGINT DEFAULT 84600000,
|
|
|
|
|
CONSTRAINT CONSUMER_KEY_CONSTRAINT UNIQUE (CONSUMER_KEY),
|
|
|
|
|
PRIMARY KEY (ID)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[IDN_OAUTH2_SCOPE_VALIDATORS]') AND TYPE IN (N'U'))
|
|
|
|
|
CREATE TABLE IDN_OAUTH2_SCOPE_VALIDATORS (
|
|
|
|
|
APP_ID INTEGER NOT NULL,
|
|
|
|
|
SCOPE_VALIDATOR VARCHAR (128) NOT NULL,
|
|
|
|
|
PRIMARY KEY (APP_ID,SCOPE_VALIDATOR),
|
|
|
|
|
FOREIGN KEY (APP_ID) REFERENCES IDN_OAUTH_CONSUMER_APPS(ID) ON DELETE CASCADE
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[IDN_OAUTH1A_REQUEST_TOKEN]') AND TYPE IN (N'U'))
|
|
|
|
|
CREATE TABLE IDN_OAUTH1A_REQUEST_TOKEN (
|
|
|
|
|
REQUEST_TOKEN VARCHAR(512),
|
|
|
|
@ -55,8 +67,8 @@ CREATE TABLE IDN_OAUTH1A_ACCESS_TOKEN (
|
|
|
|
|
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[IDN_OAUTH2_ACCESS_TOKEN]') AND TYPE IN (N'U'))
|
|
|
|
|
CREATE TABLE IDN_OAUTH2_ACCESS_TOKEN (
|
|
|
|
|
TOKEN_ID VARCHAR (255),
|
|
|
|
|
ACCESS_TOKEN VARCHAR(255),
|
|
|
|
|
REFRESH_TOKEN VARCHAR(255),
|
|
|
|
|
ACCESS_TOKEN VARCHAR(2048),
|
|
|
|
|
REFRESH_TOKEN VARCHAR(2048),
|
|
|
|
|
CONSUMER_KEY_ID INTEGER,
|
|
|
|
|
AUTHZ_USER VARCHAR (100),
|
|
|
|
|
TENANT_ID INTEGER,
|
|
|
|
@ -71,6 +83,8 @@ CREATE TABLE IDN_OAUTH2_ACCESS_TOKEN (
|
|
|
|
|
TOKEN_STATE VARCHAR(25) DEFAULT 'ACTIVE',
|
|
|
|
|
TOKEN_STATE_ID VARCHAR (128) DEFAULT 'NONE',
|
|
|
|
|
SUBJECT_IDENTIFIER VARCHAR(255),
|
|
|
|
|
ACCESS_TOKEN_HASH VARCHAR(512),
|
|
|
|
|
REFRESH_TOKEN_HASH VARCHAR(512),
|
|
|
|
|
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,
|
|
|
|
@ -81,16 +95,18 @@ CREATE INDEX IDX_AT_CK_AU ON IDN_OAUTH2_ACCESS_TOKEN(CONSUMER_KEY_ID, AUTHZ_USER
|
|
|
|
|
|
|
|
|
|
CREATE INDEX IDX_TC ON IDN_OAUTH2_ACCESS_TOKEN(TIME_CREATED);
|
|
|
|
|
|
|
|
|
|
CREATE INDEX IDX_ATH ON IDN_OAUTH2_ACCESS_TOKEN(ACCESS_TOKEN_HASH);
|
|
|
|
|
|
|
|
|
|
IF EXISTS (SELECT NAME FROM SYSINDEXES WHERE NAME = 'IDX_AT_CK_AU')
|
|
|
|
|
DROP INDEX IDN_OAUTH2_ACCESS_TOKEN.IDX_AT_CK_AU
|
|
|
|
|
|
|
|
|
|
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[IDN_OAUTH2_AUTHORIZATION_CODE]') AND TYPE IN (N'U'))
|
|
|
|
|
CREATE TABLE IDN_OAUTH2_AUTHORIZATION_CODE (
|
|
|
|
|
CODE_ID VARCHAR (255),
|
|
|
|
|
AUTHORIZATION_CODE VARCHAR(512),
|
|
|
|
|
AUTHORIZATION_CODE VARCHAR(2048),
|
|
|
|
|
CONSUMER_KEY_ID INTEGER,
|
|
|
|
|
CALLBACK_URL VARCHAR(1024),
|
|
|
|
|
SCOPE VARCHAR(2048),
|
|
|
|
|
SCOPE VARCHAR(4096),
|
|
|
|
|
AUTHZ_USER VARCHAR (100),
|
|
|
|
|
TENANT_ID INTEGER,
|
|
|
|
|
USER_DOMAIN VARCHAR(50),
|
|
|
|
@ -101,10 +117,13 @@ CREATE TABLE IDN_OAUTH2_AUTHORIZATION_CODE (
|
|
|
|
|
SUBJECT_IDENTIFIER VARCHAR(255),
|
|
|
|
|
PKCE_CODE_CHALLENGE VARCHAR (255),
|
|
|
|
|
PKCE_CODE_CHALLENGE_METHOD VARCHAR(128),
|
|
|
|
|
AUTHORIZATION_CODE_HASH VARCHAR(512),
|
|
|
|
|
PRIMARY KEY (CODE_ID),
|
|
|
|
|
FOREIGN KEY (CONSUMER_KEY_ID) REFERENCES IDN_OAUTH_CONSUMER_APPS(ID) ON DELETE CASCADE
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
CREATE INDEX IDX_AUTHORIZATION_CODE_HASH ON IDN_OAUTH2_AUTHORIZATION_CODE (AUTHORIZATION_CODE_HASH,CONSUMER_KEY_ID);
|
|
|
|
|
|
|
|
|
|
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[IDN_OAUTH2_ACCESS_TOKEN_SCOPE]') AND TYPE IN (N'U'))
|
|
|
|
|
CREATE TABLE IDN_OAUTH2_ACCESS_TOKEN_SCOPE (
|
|
|
|
|
TOKEN_ID VARCHAR (255),
|
|
|
|
@ -117,21 +136,27 @@ CREATE TABLE IDN_OAUTH2_ACCESS_TOKEN_SCOPE (
|
|
|
|
|
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[IDN_OAUTH2_SCOPE]') AND TYPE IN (N'U'))
|
|
|
|
|
CREATE TABLE IDN_OAUTH2_SCOPE (
|
|
|
|
|
SCOPE_ID INTEGER IDENTITY,
|
|
|
|
|
SCOPE_KEY VARCHAR(100) NOT NULL,
|
|
|
|
|
NAME VARCHAR(255) NULL,
|
|
|
|
|
DESCRIPTION VARCHAR(512) NULL,
|
|
|
|
|
TENANT_ID INTEGER NOT NULL DEFAULT 0,
|
|
|
|
|
ROLES VARCHAR (500) NULL,
|
|
|
|
|
NAME VARCHAR(255) NOT NULL,
|
|
|
|
|
DISPLAY_NAME VARCHAR(255) NOT NULL,
|
|
|
|
|
DESCRIPTION VARCHAR(512),
|
|
|
|
|
TENANT_ID INTEGER NOT NULL DEFAULT -1,
|
|
|
|
|
PRIMARY KEY (SCOPE_ID)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[IDN_OAUTH2_SCOPE_BINDING]') AND TYPE IN (N'U'))
|
|
|
|
|
CREATE TABLE IDN_OAUTH2_SCOPE_BINDING (
|
|
|
|
|
SCOPE_ID INTEGER NOT NULL,
|
|
|
|
|
SCOPE_BINDING VARCHAR(255),
|
|
|
|
|
FOREIGN KEY (SCOPE_ID) REFERENCES IDN_OAUTH2_SCOPE(SCOPE_ID) ON DELETE CASCADE
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[IDN_OAUTH2_RESOURCE_SCOPE]') AND TYPE IN (N'U'))
|
|
|
|
|
CREATE TABLE IDN_OAUTH2_RESOURCE_SCOPE (
|
|
|
|
|
RESOURCE_PATH VARCHAR(255) NOT NULL,
|
|
|
|
|
SCOPE_ID INTEGER NOT NULL,
|
|
|
|
|
TENANT_ID INTEGER DEFAULT -1,
|
|
|
|
|
PRIMARY KEY (RESOURCE_PATH),
|
|
|
|
|
FOREIGN KEY (SCOPE_ID) REFERENCES IDN_OAUTH2_SCOPE (SCOPE_ID) ON DELETE CASCADE ON UPDATE CASCADE
|
|
|
|
|
FOREIGN KEY (SCOPE_ID) REFERENCES IDN_OAUTH2_SCOPE (SCOPE_ID) ON DELETE CASCADE
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[IDN_SCIM_GROUP]') AND TYPE IN (N'U'))
|
|
|
|
@ -192,7 +217,7 @@ CREATE TABLE IDN_IDENTITY_USER_DATA (
|
|
|
|
|
TENANT_ID INTEGER DEFAULT -1234,
|
|
|
|
|
USER_NAME VARCHAR(255) NOT NULL,
|
|
|
|
|
DATA_KEY VARCHAR(255) NOT NULL,
|
|
|
|
|
DATA_VALUE VARCHAR(255),
|
|
|
|
|
DATA_VALUE VARCHAR(2048),
|
|
|
|
|
PRIMARY KEY (TENANT_ID, USER_NAME, DATA_KEY)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
@ -243,11 +268,14 @@ CREATE TABLE SP_APP (
|
|
|
|
|
IS_SEND_AUTH_LIST_OF_IDPS CHAR(1) DEFAULT '0',
|
|
|
|
|
IS_USE_TENANT_DOMAIN_SUBJECT CHAR(1) DEFAULT '1',
|
|
|
|
|
IS_USE_USER_DOMAIN_SUBJECT CHAR(1) DEFAULT '1',
|
|
|
|
|
ENABLE_AUTHORIZATION CHAR(1) DEFAULT '0',
|
|
|
|
|
SUBJECT_CLAIM_URI VARCHAR (512),
|
|
|
|
|
IS_SAAS_APP CHAR(1) DEFAULT '0',
|
|
|
|
|
IS_DUMB_MODE CHAR(1) DEFAULT '0',
|
|
|
|
|
PRIMARY KEY (ID),
|
|
|
|
|
CONSTRAINT APPLICATION_NAME_CONSTRAINT UNIQUE(APP_NAME, TENANT_ID));
|
|
|
|
|
CONSTRAINT APPLICATION_NAME_CONSTRAINT UNIQUE(APP_NAME, TENANT_ID)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[SP_METADATA]') AND TYPE IN (N'U'))
|
|
|
|
|
CREATE TABLE SP_METADATA (
|
|
|
|
@ -259,7 +287,8 @@ CREATE TABLE SP_METADATA (
|
|
|
|
|
TENANT_ID INTEGER DEFAULT -1,
|
|
|
|
|
PRIMARY KEY (ID),
|
|
|
|
|
CONSTRAINT SP_METADATA_CONSTRAINT UNIQUE (SP_ID, NAME),
|
|
|
|
|
FOREIGN KEY (SP_ID) REFERENCES SP_APP(ID) ON DELETE CASCADE);
|
|
|
|
|
FOREIGN KEY (SP_ID) REFERENCES SP_APP(ID) ON DELETE CASCADE
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[SP_INBOUND_AUTH]') AND TYPE IN (N'U'))
|
|
|
|
|
CREATE TABLE SP_INBOUND_AUTH (
|
|
|
|
@ -267,11 +296,14 @@ CREATE TABLE SP_INBOUND_AUTH (
|
|
|
|
|
TENANT_ID INTEGER NOT NULL,
|
|
|
|
|
INBOUND_AUTH_KEY VARCHAR (255),
|
|
|
|
|
INBOUND_AUTH_TYPE VARCHAR (255) NOT NULL,
|
|
|
|
|
INBOUND_CONFIG_TYPE VARCHAR (255) NOT NULL,
|
|
|
|
|
PROP_NAME VARCHAR (255),
|
|
|
|
|
PROP_VALUE VARCHAR (1024) ,
|
|
|
|
|
APP_ID INTEGER NOT NULL,
|
|
|
|
|
PRIMARY KEY (ID),
|
|
|
|
|
CONSTRAINT APPLICATION_ID_CONSTRAINT FOREIGN KEY (APP_ID) REFERENCES SP_APP (ID) ON DELETE CASCADE);
|
|
|
|
|
CONSTRAINT APPLICATION_ID_CONSTRAINT FOREIGN KEY (APP_ID) REFERENCES SP_APP (ID) ON DELETE CASCADE
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[SP_AUTH_STEP]') AND TYPE IN (N'U'))
|
|
|
|
|
CREATE TABLE SP_AUTH_STEP (
|
|
|
|
@ -282,7 +314,9 @@ CREATE TABLE SP_AUTH_STEP (
|
|
|
|
|
IS_SUBJECT_STEP CHAR(1) DEFAULT '0',
|
|
|
|
|
IS_ATTRIBUTE_STEP CHAR(1) DEFAULT '0',
|
|
|
|
|
PRIMARY KEY (ID),
|
|
|
|
|
CONSTRAINT APPLICATION_ID_CONSTRAINT_STEP FOREIGN KEY (APP_ID) REFERENCES SP_APP (ID) ON DELETE CASCADE);
|
|
|
|
|
CONSTRAINT APPLICATION_ID_CONSTRAINT_STEP FOREIGN KEY (APP_ID) REFERENCES SP_APP (ID) ON DELETE CASCADE
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[SP_FEDERATED_IDP]') AND TYPE IN (N'U'))
|
|
|
|
|
CREATE TABLE SP_FEDERATED_IDP (
|
|
|
|
@ -290,7 +324,9 @@ CREATE TABLE SP_FEDERATED_IDP (
|
|
|
|
|
TENANT_ID INTEGER NOT NULL,
|
|
|
|
|
AUTHENTICATOR_ID INTEGER NOT NULL,
|
|
|
|
|
PRIMARY KEY (ID, AUTHENTICATOR_ID),
|
|
|
|
|
CONSTRAINT STEP_ID_CONSTRAINT FOREIGN KEY (ID) REFERENCES SP_AUTH_STEP (ID) ON DELETE CASCADE);
|
|
|
|
|
CONSTRAINT STEP_ID_CONSTRAINT FOREIGN KEY (ID) REFERENCES SP_AUTH_STEP (ID) ON DELETE CASCADE
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[SP_CLAIM_MAPPING]') AND TYPE IN (N'U'))
|
|
|
|
|
CREATE TABLE SP_CLAIM_MAPPING (
|
|
|
|
@ -300,9 +336,12 @@ CREATE TABLE SP_CLAIM_MAPPING (
|
|
|
|
|
SP_CLAIM VARCHAR (512) NOT NULL ,
|
|
|
|
|
APP_ID INTEGER NOT NULL,
|
|
|
|
|
IS_REQUESTED VARCHAR(128) DEFAULT '0',
|
|
|
|
|
IS_MANDATORY VARCHAR(128) DEFAULT '0',
|
|
|
|
|
DEFAULT_VALUE VARCHAR(255),
|
|
|
|
|
PRIMARY KEY (ID),
|
|
|
|
|
CONSTRAINT CLAIMID_APPID_CONSTRAINT FOREIGN KEY (APP_ID) REFERENCES SP_APP (ID) ON DELETE CASCADE);
|
|
|
|
|
CONSTRAINT CLAIMID_APPID_CONSTRAINT FOREIGN KEY (APP_ID) REFERENCES SP_APP (ID) ON DELETE CASCADE
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[SP_ROLE_MAPPING]') AND TYPE IN (N'U'))
|
|
|
|
|
CREATE TABLE SP_ROLE_MAPPING (
|
|
|
|
@ -312,7 +351,9 @@ CREATE TABLE SP_ROLE_MAPPING (
|
|
|
|
|
SP_ROLE VARCHAR (255) NOT NULL ,
|
|
|
|
|
APP_ID INTEGER NOT NULL,
|
|
|
|
|
PRIMARY KEY (ID),
|
|
|
|
|
CONSTRAINT ROLEID_APPID_CONSTRAINT FOREIGN KEY (APP_ID) REFERENCES SP_APP (ID) ON DELETE CASCADE);
|
|
|
|
|
CONSTRAINT ROLEID_APPID_CONSTRAINT FOREIGN KEY (APP_ID) REFERENCES SP_APP (ID) ON DELETE CASCADE
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[SP_REQ_PATH_AUTHENTICATOR]') AND TYPE IN (N'U'))
|
|
|
|
|
CREATE TABLE SP_REQ_PATH_AUTHENTICATOR (
|
|
|
|
@ -321,7 +362,9 @@ CREATE TABLE SP_REQ_PATH_AUTHENTICATOR (
|
|
|
|
|
AUTHENTICATOR_NAME VARCHAR (255) NOT NULL ,
|
|
|
|
|
APP_ID INTEGER NOT NULL,
|
|
|
|
|
PRIMARY KEY (ID),
|
|
|
|
|
CONSTRAINT REQ_AUTH_APPID_CONSTRAINT FOREIGN KEY (APP_ID) REFERENCES SP_APP (ID) ON DELETE CASCADE);
|
|
|
|
|
CONSTRAINT REQ_AUTH_APPID_CONSTRAINT FOREIGN KEY (APP_ID) REFERENCES SP_APP (ID) ON DELETE CASCADE
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[SP_PROVISIONING_CONNECTOR]') AND TYPE IN (N'U'))
|
|
|
|
|
CREATE TABLE SP_PROVISIONING_CONNECTOR (
|
|
|
|
@ -332,8 +375,21 @@ CREATE TABLE SP_PROVISIONING_CONNECTOR (
|
|
|
|
|
APP_ID INTEGER NOT NULL,
|
|
|
|
|
IS_JIT_ENABLED CHAR(1) NOT NULL DEFAULT '0',
|
|
|
|
|
BLOCKING CHAR(1) NOT NULL DEFAULT '0',
|
|
|
|
|
RULE_ENABLED CHAR(1) NOT NULL DEFAULT '0',
|
|
|
|
|
PRIMARY KEY (ID),
|
|
|
|
|
CONSTRAINT PRO_CONNECTOR_APPID_CONSTRAINT FOREIGN KEY (APP_ID) REFERENCES SP_APP (ID) ON DELETE CASCADE);
|
|
|
|
|
CONSTRAINT PRO_CONNECTOR_APPID_CONSTRAINT FOREIGN KEY (APP_ID) REFERENCES SP_APP (ID) ON DELETE CASCADE
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
IF NOT EXISTS(SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[SP_AUTH_SCRIPT]') AND TYPE IN (N'U'))
|
|
|
|
|
CREATE TABLE SP_AUTH_SCRIPT (
|
|
|
|
|
ID INTEGER IDENTITY NOT NULL,
|
|
|
|
|
TENANT_ID INTEGER NOT NULL,
|
|
|
|
|
APP_ID INTEGER NOT NULL,
|
|
|
|
|
TYPE VARCHAR(255) NOT NULL,
|
|
|
|
|
CONTENT VARBINARY(MAX) DEFAULT NULL,
|
|
|
|
|
IS_ENABLED CHAR(1) NOT NULL DEFAULT '0',
|
|
|
|
|
PRIMARY KEY (ID)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[IDP]') AND TYPE IN (N'U'))
|
|
|
|
|
CREATE TABLE IDP (
|
|
|
|
@ -358,9 +414,8 @@ CREATE TABLE IDP (
|
|
|
|
|
IS_LOCAL_CLAIM_DIALECT CHAR(1) NOT NULL DEFAULT '0',
|
|
|
|
|
PRIMARY KEY (ID),
|
|
|
|
|
DISPLAY_NAME VARCHAR(255),
|
|
|
|
|
UNIQUE (TENANT_ID, NAME));
|
|
|
|
|
|
|
|
|
|
INSERT INTO IDP (TENANT_ID, NAME, HOME_REALM_ID) VALUES (-1234, 'LOCAL', 'localhost');
|
|
|
|
|
UNIQUE (TENANT_ID, NAME)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[IDP_ROLE]') AND TYPE IN (N'U'))
|
|
|
|
|
CREATE TABLE IDP_ROLE (
|
|
|
|
@ -370,7 +425,8 @@ CREATE TABLE IDP_ROLE (
|
|
|
|
|
ROLE VARCHAR(254),
|
|
|
|
|
PRIMARY KEY (ID),
|
|
|
|
|
UNIQUE (IDP_ID, ROLE),
|
|
|
|
|
FOREIGN KEY (IDP_ID) REFERENCES IDP(ID) ON DELETE CASCADE);
|
|
|
|
|
FOREIGN KEY (IDP_ID) REFERENCES IDP(ID) ON DELETE CASCADE
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[IDP_ROLE_MAPPING]') AND TYPE IN (N'U'))
|
|
|
|
|
CREATE TABLE IDP_ROLE_MAPPING (
|
|
|
|
@ -381,7 +437,8 @@ CREATE TABLE IDP_ROLE_MAPPING (
|
|
|
|
|
LOCAL_ROLE VARCHAR(253),
|
|
|
|
|
PRIMARY KEY (ID),
|
|
|
|
|
UNIQUE (IDP_ROLE_ID, TENANT_ID, USER_STORE_ID, LOCAL_ROLE),
|
|
|
|
|
FOREIGN KEY (IDP_ROLE_ID) REFERENCES IDP_ROLE(ID) ON DELETE CASCADE);
|
|
|
|
|
FOREIGN KEY (IDP_ROLE_ID) REFERENCES IDP_ROLE(ID) ON DELETE CASCADE
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[IDP_CLAIM]') AND TYPE IN (N'U'))
|
|
|
|
|
CREATE TABLE IDP_CLAIM (
|
|
|
|
@ -391,7 +448,8 @@ CREATE TABLE IDP_CLAIM (
|
|
|
|
|
CLAIM VARCHAR(254),
|
|
|
|
|
PRIMARY KEY (ID),
|
|
|
|
|
UNIQUE (IDP_ID, CLAIM),
|
|
|
|
|
FOREIGN KEY (IDP_ID) REFERENCES IDP(ID) ON DELETE CASCADE);
|
|
|
|
|
FOREIGN KEY (IDP_ID) REFERENCES IDP(ID) ON DELETE CASCADE
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[IDP_CLAIM_MAPPING]') AND TYPE IN (N'U'))
|
|
|
|
|
CREATE TABLE IDP_CLAIM_MAPPING (
|
|
|
|
@ -403,7 +461,8 @@ CREATE TABLE IDP_CLAIM_MAPPING (
|
|
|
|
|
IS_REQUESTED VARCHAR(128) DEFAULT '0',
|
|
|
|
|
PRIMARY KEY (ID),
|
|
|
|
|
UNIQUE (IDP_CLAIM_ID, TENANT_ID, LOCAL_CLAIM),
|
|
|
|
|
FOREIGN KEY (IDP_CLAIM_ID) REFERENCES IDP_CLAIM(ID) ON DELETE CASCADE);
|
|
|
|
|
FOREIGN KEY (IDP_CLAIM_ID) REFERENCES IDP_CLAIM(ID) ON DELETE CASCADE
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[IDP_AUTHENTICATOR]') AND TYPE IN (N'U'))
|
|
|
|
|
CREATE TABLE IDP_AUTHENTICATOR (
|
|
|
|
@ -415,11 +474,8 @@ CREATE TABLE IDP_AUTHENTICATOR (
|
|
|
|
|
DISPLAY_NAME VARCHAR(255),
|
|
|
|
|
PRIMARY KEY (ID),
|
|
|
|
|
UNIQUE (TENANT_ID, IDP_ID, NAME),
|
|
|
|
|
FOREIGN KEY (IDP_ID) REFERENCES IDP(ID) ON DELETE CASCADE);
|
|
|
|
|
|
|
|
|
|
INSERT INTO IDP_AUTHENTICATOR (TENANT_ID, IDP_ID, NAME) VALUES (-1234, 1, 'samlsso');
|
|
|
|
|
INSERT INTO IDP_AUTHENTICATOR (TENANT_ID, IDP_ID, NAME) VALUES (-1234, 1, 'IDPProperties');
|
|
|
|
|
INSERT INTO IDP_AUTHENTICATOR (TENANT_ID, IDP_ID, NAME) VALUES (-1234, 1, 'passivests');
|
|
|
|
|
FOREIGN KEY (IDP_ID) REFERENCES IDP(ID) ON DELETE CASCADE
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[IDP_METADATA]') AND TYPE IN (N'U'))
|
|
|
|
|
CREATE TABLE IDP_METADATA (
|
|
|
|
@ -431,10 +487,8 @@ CREATE TABLE IDP_METADATA (
|
|
|
|
|
TENANT_ID INTEGER DEFAULT -1,
|
|
|
|
|
PRIMARY KEY (ID),
|
|
|
|
|
CONSTRAINT IDP_METADATA_CONSTRAINT UNIQUE (IDP_ID, NAME),
|
|
|
|
|
FOREIGN KEY (IDP_ID) REFERENCES IDP(ID) ON DELETE CASCADE);
|
|
|
|
|
|
|
|
|
|
INSERT INTO IDP_METADATA (IDP_ID, NAME, VALUE, DISPLAY_NAME) VALUES (1, 'SessionIdleTimeout', '20160', 'Session Idle Timeout');
|
|
|
|
|
INSERT INTO IDP_METADATA (IDP_ID, NAME, VALUE, DISPLAY_NAME) VALUES (1, 'RememberMeTimeout', '15', 'RememberMe Timeout');
|
|
|
|
|
FOREIGN KEY (IDP_ID) REFERENCES IDP(ID) ON DELETE CASCADE
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[IDP_AUTHENTICATOR_PROPERTY]') AND TYPE IN (N'U'))
|
|
|
|
|
CREATE TABLE IDP_AUTHENTICATOR_PROPERTY (
|
|
|
|
@ -446,10 +500,8 @@ CREATE TABLE IDP_AUTHENTICATOR_PROPERTY (
|
|
|
|
|
IS_SECRET CHAR (1) DEFAULT '0',
|
|
|
|
|
PRIMARY KEY (ID),
|
|
|
|
|
UNIQUE (TENANT_ID, AUTHENTICATOR_ID, PROPERTY_KEY),
|
|
|
|
|
FOREIGN KEY (AUTHENTICATOR_ID) REFERENCES IDP_AUTHENTICATOR(ID) ON DELETE CASCADE);
|
|
|
|
|
|
|
|
|
|
INSERT INTO IDP_AUTHENTICATOR_PROPERTY (TENANT_ID, AUTHENTICATOR_ID, PROPERTY_KEY,PROPERTY_VALUE, IS_SECRET ) VALUES (-1234, 1 , 'IdPEntityId', 'localhost', '0');
|
|
|
|
|
INSERT INTO IDP_AUTHENTICATOR_PROPERTY (TENANT_ID, AUTHENTICATOR_ID, PROPERTY_KEY,PROPERTY_VALUE, IS_SECRET ) VALUES (-1234, 3 , 'IdPEntityId', 'localhost', '0');
|
|
|
|
|
FOREIGN KEY (AUTHENTICATOR_ID) REFERENCES IDP_AUTHENTICATOR(ID) ON DELETE CASCADE
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[IDP_PROVISIONING_CONFIG]') AND TYPE IN (N'U'))
|
|
|
|
|
CREATE TABLE IDP_PROVISIONING_CONFIG (
|
|
|
|
@ -459,9 +511,11 @@ CREATE TABLE IDP_PROVISIONING_CONFIG (
|
|
|
|
|
PROVISIONING_CONNECTOR_TYPE VARCHAR(255) NOT NULL,
|
|
|
|
|
IS_ENABLED CHAR (1) DEFAULT '0',
|
|
|
|
|
IS_BLOCKING CHAR (1) DEFAULT '0',
|
|
|
|
|
IS_RULES_ENABLED CHAR (1) DEFAULT '0',
|
|
|
|
|
PRIMARY KEY (ID),
|
|
|
|
|
UNIQUE (TENANT_ID, IDP_ID, PROVISIONING_CONNECTOR_TYPE),
|
|
|
|
|
FOREIGN KEY (IDP_ID) REFERENCES IDP(ID) ON DELETE CASCADE);
|
|
|
|
|
FOREIGN KEY (IDP_ID) REFERENCES IDP(ID) ON DELETE CASCADE
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[IDP_PROV_CONFIG_PROPERTY]') AND TYPE IN (N'U'))
|
|
|
|
|
CREATE TABLE IDP_PROV_CONFIG_PROPERTY (
|
|
|
|
@ -475,7 +529,8 @@ CREATE TABLE IDP_PROV_CONFIG_PROPERTY (
|
|
|
|
|
IS_SECRET CHAR (1) DEFAULT '0',
|
|
|
|
|
PRIMARY KEY (ID),
|
|
|
|
|
UNIQUE (TENANT_ID, PROVISIONING_CONFIG_ID, PROPERTY_KEY),
|
|
|
|
|
FOREIGN KEY (PROVISIONING_CONFIG_ID) REFERENCES IDP_PROVISIONING_CONFIG(ID) ON DELETE CASCADE);
|
|
|
|
|
FOREIGN KEY (PROVISIONING_CONFIG_ID) REFERENCES IDP_PROVISIONING_CONFIG(ID) ON DELETE CASCADE
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[IDP_PROVISIONING_ENTITY]') AND TYPE IN (N'U'))
|
|
|
|
|
CREATE TABLE IDP_PROVISIONING_ENTITY (
|
|
|
|
@ -490,7 +545,8 @@ CREATE TABLE IDP_PROVISIONING_ENTITY (
|
|
|
|
|
PRIMARY KEY (ID),
|
|
|
|
|
UNIQUE (ENTITY_TYPE, TENANT_ID, ENTITY_LOCAL_USERSTORE, ENTITY_NAME, PROVISIONING_CONFIG_ID),
|
|
|
|
|
UNIQUE (PROVISIONING_CONFIG_ID, ENTITY_TYPE, ENTITY_VALUE),
|
|
|
|
|
FOREIGN KEY (PROVISIONING_CONFIG_ID) REFERENCES IDP_PROVISIONING_CONFIG(ID) ON DELETE CASCADE);
|
|
|
|
|
FOREIGN KEY (PROVISIONING_CONFIG_ID) REFERENCES IDP_PROVISIONING_CONFIG(ID) ON DELETE CASCADE
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[IDP_LOCAL_CLAIM]') AND TYPE IN (N'U'))
|
|
|
|
|
CREATE TABLE IDP_LOCAL_CLAIM (
|
|
|
|
@ -502,7 +558,8 @@ CREATE TABLE IDP_LOCAL_CLAIM (
|
|
|
|
|
IS_REQUESTED VARCHAR(128) DEFAULT '0',
|
|
|
|
|
PRIMARY KEY (ID),
|
|
|
|
|
UNIQUE (TENANT_ID, IDP_ID, CLAIM_URI),
|
|
|
|
|
FOREIGN KEY (IDP_ID) REFERENCES IDP(ID) ON DELETE CASCADE);
|
|
|
|
|
FOREIGN KEY (IDP_ID) REFERENCES IDP(ID) ON DELETE CASCADE
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[IDN_ASSOCIATED_ID]') AND TYPE IN (N'U'))
|
|
|
|
|
CREATE TABLE IDN_ASSOCIATED_ID (
|
|
|
|
@ -523,7 +580,8 @@ CREATE TABLE IDN_USER_ACCOUNT_ASSOCIATION (
|
|
|
|
|
TENANT_ID INTEGER,
|
|
|
|
|
DOMAIN_NAME VARCHAR(255) NOT NULL,
|
|
|
|
|
USER_NAME VARCHAR(255) NOT NULL,
|
|
|
|
|
PRIMARY KEY (TENANT_ID, DOMAIN_NAME, USER_NAME));
|
|
|
|
|
PRIMARY KEY (TENANT_ID, DOMAIN_NAME, USER_NAME)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[FIDO_DEVICE_STORE]') AND TYPE IN (N'U'))
|
|
|
|
|
CREATE TABLE FIDO_DEVICE_STORE (
|
|
|
|
@ -533,7 +591,8 @@ CREATE TABLE FIDO_DEVICE_STORE (
|
|
|
|
|
TIME_REGISTERED DATETIME,
|
|
|
|
|
KEY_HANDLE VARCHAR(200) NOT NULL,
|
|
|
|
|
DEVICE_DATA VARCHAR(2048) NOT NULL,
|
|
|
|
|
PRIMARY KEY (TENANT_ID, DOMAIN_NAME, USER_NAME, KEY_HANDLE));
|
|
|
|
|
PRIMARY KEY (TENANT_ID, DOMAIN_NAME, USER_NAME, KEY_HANDLE)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[WF_REQUEST]') AND TYPE IN (N'U'))
|
|
|
|
|
CREATE TABLE WF_REQUEST (
|
|
|
|
@ -554,7 +613,7 @@ CREATE TABLE WF_BPS_PROFILE (
|
|
|
|
|
HOST_URL_MANAGER VARCHAR(255),
|
|
|
|
|
HOST_URL_WORKER VARCHAR(255),
|
|
|
|
|
USERNAME VARCHAR(45),
|
|
|
|
|
PASSWORD VARCHAR(255),
|
|
|
|
|
PASSWORD VARCHAR(1023),
|
|
|
|
|
CALLBACK_HOST VARCHAR (45),
|
|
|
|
|
TENANT_ID INTEGER DEFAULT -1,
|
|
|
|
|
PRIMARY KEY (PROFILE_NAME, TENANT_ID)
|
|
|
|
@ -620,6 +679,282 @@ CREATE TABLE WF_WORKFLOW_REQUEST_RELATION(
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[IDN_RECOVERY_DATA]') AND TYPE IN (N'U'))
|
|
|
|
|
CREATE TABLE IDN_RECOVERY_DATA (
|
|
|
|
|
USER_NAME VARCHAR(255) NOT NULL,
|
|
|
|
|
USER_DOMAIN VARCHAR(127) NOT NULL,
|
|
|
|
|
TENANT_ID INTEGER DEFAULT -1,
|
|
|
|
|
CODE VARCHAR(255) NOT NULL,
|
|
|
|
|
SCENARIO VARCHAR(255) NOT NULL,
|
|
|
|
|
STEP VARCHAR(127) NOT NULL,
|
|
|
|
|
TIME_CREATED DATETIME NOT NULL,
|
|
|
|
|
REMAINING_SETS VARCHAR(2500) DEFAULT NULL,
|
|
|
|
|
PRIMARY KEY(USER_NAME, USER_DOMAIN, TENANT_ID, SCENARIO,STEP),
|
|
|
|
|
UNIQUE(CODE)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[IDN_PASSWORD_HISTORY_DATA]') AND TYPE IN (N'U'))
|
|
|
|
|
CREATE TABLE IDN_PASSWORD_HISTORY_DATA (
|
|
|
|
|
ID INTEGER NOT NULL IDENTITY ,
|
|
|
|
|
USER_NAME VARCHAR(255) NOT NULL,
|
|
|
|
|
USER_DOMAIN VARCHAR(127) NOT NULL,
|
|
|
|
|
TENANT_ID INTEGER DEFAULT -1,
|
|
|
|
|
SALT_VALUE VARCHAR(255),
|
|
|
|
|
HASH VARCHAR(255) NOT NULL,
|
|
|
|
|
TIME_CREATED DATETIME NOT NULL,
|
|
|
|
|
PRIMARY KEY (ID),
|
|
|
|
|
UNIQUE (USER_NAME,USER_DOMAIN,TENANT_ID,SALT_VALUE,HASH),
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[IDN_CLAIM_DIALECT]') AND TYPE IN (N'U'))
|
|
|
|
|
CREATE TABLE IDN_CLAIM_DIALECT (
|
|
|
|
|
ID INTEGER NOT NULL IDENTITY,
|
|
|
|
|
DIALECT_URI VARCHAR (255) NOT NULL,
|
|
|
|
|
TENANT_ID INTEGER NOT NULL,
|
|
|
|
|
PRIMARY KEY (ID),
|
|
|
|
|
CONSTRAINT DIALECT_URI_CONSTRAINT UNIQUE (DIALECT_URI, TENANT_ID)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[IDN_CLAIM]') AND TYPE IN (N'U'))
|
|
|
|
|
CREATE TABLE IDN_CLAIM (
|
|
|
|
|
ID INTEGER NOT NULL IDENTITY,
|
|
|
|
|
DIALECT_ID INTEGER,
|
|
|
|
|
CLAIM_URI VARCHAR (255) NOT NULL,
|
|
|
|
|
TENANT_ID INTEGER NOT NULL,
|
|
|
|
|
PRIMARY KEY (ID),
|
|
|
|
|
FOREIGN KEY (DIALECT_ID) REFERENCES IDN_CLAIM_DIALECT(ID) ON DELETE CASCADE,
|
|
|
|
|
CONSTRAINT CLAIM_URI_CONSTRAINT UNIQUE (DIALECT_ID, CLAIM_URI, TENANT_ID)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[IDN_CLAIM_MAPPED_ATTRIBUTE]') AND TYPE IN (N'U'))
|
|
|
|
|
CREATE TABLE IDN_CLAIM_MAPPED_ATTRIBUTE (
|
|
|
|
|
ID INTEGER NOT NULL IDENTITY,
|
|
|
|
|
LOCAL_CLAIM_ID INTEGER,
|
|
|
|
|
USER_STORE_DOMAIN_NAME VARCHAR (255) NOT NULL,
|
|
|
|
|
ATTRIBUTE_NAME VARCHAR (255) NOT NULL,
|
|
|
|
|
TENANT_ID INTEGER NOT NULL,
|
|
|
|
|
PRIMARY KEY (ID),
|
|
|
|
|
FOREIGN KEY (LOCAL_CLAIM_ID) REFERENCES IDN_CLAIM(ID) ON DELETE CASCADE,
|
|
|
|
|
CONSTRAINT USER_STORE_DOMAIN_CONSTRAINT UNIQUE (LOCAL_CLAIM_ID, USER_STORE_DOMAIN_NAME, TENANT_ID)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[IDN_CLAIM_PROPERTY]') AND TYPE IN (N'U'))
|
|
|
|
|
CREATE TABLE IDN_CLAIM_PROPERTY (
|
|
|
|
|
ID INTEGER NOT NULL IDENTITY,
|
|
|
|
|
LOCAL_CLAIM_ID INTEGER,
|
|
|
|
|
PROPERTY_NAME VARCHAR (255) NOT NULL,
|
|
|
|
|
PROPERTY_VALUE VARCHAR (255) NOT NULL,
|
|
|
|
|
TENANT_ID INTEGER NOT NULL,
|
|
|
|
|
PRIMARY KEY (ID),
|
|
|
|
|
FOREIGN KEY (LOCAL_CLAIM_ID) REFERENCES IDN_CLAIM(ID) ON DELETE CASCADE,
|
|
|
|
|
CONSTRAINT PROPERTY_NAME_CONSTRAINT UNIQUE (LOCAL_CLAIM_ID, PROPERTY_NAME, TENANT_ID)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[IDN_CLAIM_MAPPING]') AND TYPE IN (N'U'))
|
|
|
|
|
CREATE TABLE IDN_CLAIM_MAPPING (
|
|
|
|
|
ID INTEGER NOT NULL IDENTITY,
|
|
|
|
|
EXT_CLAIM_ID INTEGER NOT NULL,
|
|
|
|
|
MAPPED_LOCAL_CLAIM_ID INTEGER NOT NULL,
|
|
|
|
|
TENANT_ID INTEGER NOT NULL,
|
|
|
|
|
PRIMARY KEY (ID),
|
|
|
|
|
FOREIGN KEY (EXT_CLAIM_ID) REFERENCES IDN_CLAIM(ID) ON DELETE CASCADE ,
|
|
|
|
|
FOREIGN KEY (MAPPED_LOCAL_CLAIM_ID) REFERENCES IDN_CLAIM(ID) ON DELETE NO ACTION ,
|
|
|
|
|
CONSTRAINT EXT_TO_LOC_MAPPING_CONSTRN UNIQUE (EXT_CLAIM_ID, TENANT_ID)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[IDN_SAML2_ASSERTION_STORE]') AND TYPE IN (N'U'))
|
|
|
|
|
CREATE TABLE IDN_SAML2_ASSERTION_STORE (
|
|
|
|
|
ID INTEGER NOT NULL IDENTITY,
|
|
|
|
|
SAML2_ID VARCHAR(255) ,
|
|
|
|
|
SAML2_ISSUER VARCHAR(255) ,
|
|
|
|
|
SAML2_SUBJECT VARCHAR(255) ,
|
|
|
|
|
SAML2_SESSION_INDEX VARCHAR(255) ,
|
|
|
|
|
SAML2_AUTHN_CONTEXT_CLASS_REF VARCHAR(255) ,
|
|
|
|
|
SAML2_ASSERTION VARCHAR(4096) ,
|
|
|
|
|
PRIMARY KEY (ID)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[IDN_OIDC_JTI]') AND TYPE IN (N'U'))
|
|
|
|
|
CREATE TABLE IDN_OIDC_JTI (
|
|
|
|
|
JWT_ID VARCHAR(255) NOT NULL,
|
|
|
|
|
EXP_TIME DATETIME NOT NULL,
|
|
|
|
|
TIME_CREATED DATETIME NOT NULL,
|
|
|
|
|
PRIMARY KEY (JWT_ID)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[IDN_OIDC_PROPERTY]') AND TYPE IN (N'U'))
|
|
|
|
|
CREATE TABLE IDN_OIDC_PROPERTY (
|
|
|
|
|
ID INTEGER NOT NULL IDENTITY,
|
|
|
|
|
TENANT_ID INTEGER ,
|
|
|
|
|
CONSUMER_KEY VARCHAR(255) ,
|
|
|
|
|
PROPERTY_KEY VARCHAR(255) NOT NULL ,
|
|
|
|
|
PROPERTY_VALUE VARCHAR(2047) ,
|
|
|
|
|
PRIMARY KEY (ID),
|
|
|
|
|
FOREIGN KEY (CONSUMER_KEY) REFERENCES IDN_OAUTH_CONSUMER_APPS(CONSUMER_KEY) ON DELETE CASCADE
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[IDN_OIDC_REQ_OBJECT_REFERENCE]') AND TYPE IN (N'U'))
|
|
|
|
|
CREATE TABLE IDN_OIDC_REQ_OBJECT_REFERENCE (
|
|
|
|
|
ID INTEGER NOT NULL IDENTITY,
|
|
|
|
|
CONSUMER_KEY_ID INTEGER ,
|
|
|
|
|
CODE_ID VARCHAR(255) ,
|
|
|
|
|
TOKEN_ID VARCHAR(255) ,
|
|
|
|
|
SESSION_DATA_KEY VARCHAR(255),
|
|
|
|
|
PRIMARY KEY (ID),
|
|
|
|
|
FOREIGN KEY (CONSUMER_KEY_ID) REFERENCES IDN_OAUTH_CONSUMER_APPS(ID) ON DELETE CASCADE ,
|
|
|
|
|
FOREIGN KEY (TOKEN_ID) REFERENCES IDN_OAUTH2_ACCESS_TOKEN(TOKEN_ID),
|
|
|
|
|
FOREIGN KEY (CODE_ID) REFERENCES IDN_OAUTH2_AUTHORIZATION_CODE(CODE_ID)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[IDN_OIDC_REQ_OBJECT_CLAIMS]') AND TYPE IN (N'U'))
|
|
|
|
|
CREATE TABLE IDN_OIDC_REQ_OBJECT_CLAIMS (
|
|
|
|
|
ID INTEGER NOT NULL IDENTITY,
|
|
|
|
|
REQ_OBJECT_ID INTEGER,
|
|
|
|
|
CLAIM_ATTRIBUTE VARCHAR(255) ,
|
|
|
|
|
ESSENTIAL CHAR(1) NOT NULL DEFAULT '0' ,
|
|
|
|
|
VALUE VARCHAR(255) ,
|
|
|
|
|
IS_USERINFO CHAR(1) NOT NULL DEFAULT '0',
|
|
|
|
|
PRIMARY KEY (ID),
|
|
|
|
|
FOREIGN KEY (REQ_OBJECT_ID) REFERENCES IDN_OIDC_REQ_OBJECT_REFERENCE (ID) ON DELETE CASCADE
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[IDN_OIDC_REQ_OBJ_CLAIM_VALUES]') AND TYPE IN (N'U'))
|
|
|
|
|
CREATE TABLE IDN_OIDC_REQ_OBJ_CLAIM_VALUES (
|
|
|
|
|
ID INTEGER NOT NULL IDENTITY,
|
|
|
|
|
REQ_OBJECT_CLAIMS_ID INTEGER ,
|
|
|
|
|
CLAIM_VALUES VARCHAR(255) ,
|
|
|
|
|
PRIMARY KEY (ID),
|
|
|
|
|
FOREIGN KEY (REQ_OBJECT_CLAIMS_ID) REFERENCES IDN_OIDC_REQ_OBJECT_CLAIMS(ID) ON DELETE CASCADE
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[IDN_CERTIFICATE]') AND TYPE IN (N'U'))
|
|
|
|
|
CREATE TABLE IDN_CERTIFICATE (
|
|
|
|
|
ID INTEGER IDENTITY,
|
|
|
|
|
NAME VARCHAR(100),
|
|
|
|
|
CERTIFICATE_IN_PEM VARBINARY(MAX),
|
|
|
|
|
TENANT_ID INTEGER DEFAULT 0,
|
|
|
|
|
PRIMARY KEY(ID),
|
|
|
|
|
CONSTRAINT CERTIFICATE_UNIQUE_KEY UNIQUE (NAME, TENANT_ID)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
-- Start of CONSENT-MGT Tables --
|
|
|
|
|
|
|
|
|
|
IF NOT EXISTS ( SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[CM_PII_CATEGORY]') AND TYPE IN (N'U'))
|
|
|
|
|
CREATE TABLE CM_PII_CATEGORY (
|
|
|
|
|
ID INTEGER NOT NULL IDENTITY,
|
|
|
|
|
NAME VARCHAR(255) NOT NULL,
|
|
|
|
|
DESCRIPTION VARCHAR(1023),
|
|
|
|
|
DISPLAY_NAME VARCHAR(255),
|
|
|
|
|
IS_SENSITIVE INTEGER NOT NULL,
|
|
|
|
|
TENANT_ID INTEGER DEFAULT '-1234',
|
|
|
|
|
CONSTRAINT CM_PII_CATEGORY_CNT UNIQUE (NAME, TENANT_ID),
|
|
|
|
|
PRIMARY KEY (ID)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
IF NOT EXISTS ( SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[CM_RECEIPT]') AND TYPE IN (N'U'))
|
|
|
|
|
CREATE TABLE CM_RECEIPT (
|
|
|
|
|
CONSENT_RECEIPT_ID VARCHAR(255) NOT NULL,
|
|
|
|
|
VERSION VARCHAR(255) NOT NULL,
|
|
|
|
|
JURISDICTION VARCHAR(255) NOT NULL,
|
|
|
|
|
CONSENT_TIMESTAMP DATETIME NOT NULL,
|
|
|
|
|
COLLECTION_METHOD VARCHAR(255) NOT NULL,
|
|
|
|
|
LANGUAGE VARCHAR(255) NOT NULL,
|
|
|
|
|
PII_PRINCIPAL_ID VARCHAR(255) NOT NULL,
|
|
|
|
|
PRINCIPAL_TENANT_ID INTEGER DEFAULT '-1234',
|
|
|
|
|
POLICY_URL VARCHAR(255) NOT NULL,
|
|
|
|
|
STATE VARCHAR(255) NOT NULL,
|
|
|
|
|
PII_CONTROLLER VARCHAR(2048) NOT NULL,
|
|
|
|
|
PRIMARY KEY (CONSENT_RECEIPT_ID)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
IF NOT EXISTS ( SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[CM_PURPOSE]') AND TYPE IN (N'U'))
|
|
|
|
|
CREATE TABLE CM_PURPOSE (
|
|
|
|
|
ID INTEGER NOT NULL IDENTITY,
|
|
|
|
|
NAME VARCHAR(255) NOT NULL,
|
|
|
|
|
DESCRIPTION VARCHAR(1023),
|
|
|
|
|
TENANT_ID INTEGER DEFAULT '-1234',
|
|
|
|
|
CONSTRAINT CM_PURPOSE_CNT UNIQUE (NAME, TENANT_ID),
|
|
|
|
|
PRIMARY KEY (ID)
|
|
|
|
|
);
|
|
|
|
|
IF NOT EXISTS ( SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[CM_PURPOSE_CATEGORY]') AND TYPE IN (N'U'))
|
|
|
|
|
CREATE TABLE CM_PURPOSE_CATEGORY (
|
|
|
|
|
ID INTEGER NOT NULL IDENTITY,
|
|
|
|
|
NAME VARCHAR(255) NOT NULL,
|
|
|
|
|
DESCRIPTION VARCHAR(1023),
|
|
|
|
|
TENANT_ID INTEGER DEFAULT '-1234',
|
|
|
|
|
CONSTRAINT CM_PURPOSE_CATEGORY_CNT UNIQUE (NAME, TENANT_ID),
|
|
|
|
|
PRIMARY KEY (ID)
|
|
|
|
|
);
|
|
|
|
|
IF NOT EXISTS ( SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[CM_RECEIPT_SP_ASSOC]') AND TYPE IN (N'U'))
|
|
|
|
|
CREATE TABLE CM_RECEIPT_SP_ASSOC (
|
|
|
|
|
ID INTEGER NOT NULL IDENTITY,
|
|
|
|
|
CONSENT_RECEIPT_ID VARCHAR(255) NOT NULL,
|
|
|
|
|
SP_NAME VARCHAR(255) NOT NULL,
|
|
|
|
|
SP_DISPLAY_NAME VARCHAR(255),
|
|
|
|
|
SP_DESCRIPTION VARCHAR(255),
|
|
|
|
|
SP_TENANT_ID INTEGER DEFAULT '-1234',
|
|
|
|
|
CONSTRAINT CM_RECEIPT_SP_ASSOC_CNT UNIQUE (CONSENT_RECEIPT_ID, SP_NAME, SP_TENANT_ID),
|
|
|
|
|
FOREIGN KEY (CONSENT_RECEIPT_ID) REFERENCES CM_RECEIPT (CONSENT_RECEIPT_ID),
|
|
|
|
|
PRIMARY KEY (ID)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
IF NOT EXISTS ( SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[CM_SP_PURPOSE_ASSOC]') AND TYPE IN (N'U'))
|
|
|
|
|
CREATE TABLE CM_SP_PURPOSE_ASSOC (
|
|
|
|
|
ID INTEGER NOT NULL IDENTITY,
|
|
|
|
|
RECEIPT_SP_ASSOC INTEGER NOT NULL,
|
|
|
|
|
PURPOSE_ID INTEGER NOT NULL,
|
|
|
|
|
CONSENT_TYPE VARCHAR(255) NOT NULL,
|
|
|
|
|
IS_PRIMARY_PURPOSE INTEGER NOT NULL,
|
|
|
|
|
TERMINATION VARCHAR(255) NOT NULL,
|
|
|
|
|
THIRD_PARTY_DISCLOSURE INTEGER NOT NULL,
|
|
|
|
|
THIRD_PARTY_NAME VARCHAR(255),
|
|
|
|
|
CONSTRAINT CM_SP_PURPOSE_ASSOC_CNT UNIQUE (RECEIPT_SP_ASSOC, PURPOSE_ID),
|
|
|
|
|
FOREIGN KEY (RECEIPT_SP_ASSOC) REFERENCES CM_RECEIPT_SP_ASSOC (ID),
|
|
|
|
|
FOREIGN KEY (PURPOSE_ID) REFERENCES CM_PURPOSE (ID),
|
|
|
|
|
PRIMARY KEY (ID)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
IF NOT EXISTS ( SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[CM_SP_PURPOSE_PURPOSE_CAT_ASSC]') AND TYPE IN (N'U'))
|
|
|
|
|
CREATE TABLE CM_SP_PURPOSE_PURPOSE_CAT_ASSC (
|
|
|
|
|
SP_PURPOSE_ASSOC_ID INTEGER NOT NULL,
|
|
|
|
|
PURPOSE_CATEGORY_ID INTEGER NOT NULL,
|
|
|
|
|
CONSTRAINT CM_SP_PURPOSE_PURPOSE_CAT_ASSC_CNT UNIQUE (SP_PURPOSE_ASSOC_ID, PURPOSE_CATEGORY_ID),
|
|
|
|
|
FOREIGN KEY (SP_PURPOSE_ASSOC_ID) REFERENCES CM_SP_PURPOSE_ASSOC (ID),
|
|
|
|
|
FOREIGN KEY (PURPOSE_CATEGORY_ID) REFERENCES CM_PURPOSE_CATEGORY (ID)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
IF NOT EXISTS ( SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[CM_PURPOSE_PII_CAT_ASSOC]') AND TYPE IN (N'U'))
|
|
|
|
|
CREATE TABLE CM_PURPOSE_PII_CAT_ASSOC (
|
|
|
|
|
PURPOSE_ID INTEGER NOT NULL,
|
|
|
|
|
CM_PII_CATEGORY_ID INTEGER NOT NULL,
|
|
|
|
|
CONSTRAINT CM_PURPOSE_PII_CAT_ASSOC_CNT UNIQUE (PURPOSE_ID, CM_PII_CATEGORY_ID)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
IF NOT EXISTS ( SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[CM_SP_PURPOSE_PII_CAT_ASSOC]') AND TYPE IN (N'U'))
|
|
|
|
|
CREATE TABLE CM_SP_PURPOSE_PII_CAT_ASSOC (
|
|
|
|
|
SP_PURPOSE_ASSOC_ID INTEGER NOT NULL,
|
|
|
|
|
PII_CATEGORY_ID INTEGER NOT NULL,
|
|
|
|
|
VALIDITY VARCHAR(1023),
|
|
|
|
|
CONSTRAINT CM_SP_PURPOSE_PII_CAT_ASSOC_CNT UNIQUE (SP_PURPOSE_ASSOC_ID, PII_CATEGORY_ID),
|
|
|
|
|
FOREIGN KEY (PII_CATEGORY_ID) REFERENCES CM_PII_CATEGORY (ID),
|
|
|
|
|
FOREIGN KEY (SP_PURPOSE_ASSOC_ID) REFERENCES CM_SP_PURPOSE_ASSOC (ID)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
IF NOT EXISTS ( SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[CM_CONSENT_RECEIPT_PROPERTY]') AND TYPE IN (N'U'))
|
|
|
|
|
CREATE TABLE CM_CONSENT_RECEIPT_PROPERTY (
|
|
|
|
|
CONSENT_RECEIPT_ID VARCHAR(255) NOT NULL,
|
|
|
|
|
NAME VARCHAR(255) NOT NULL,
|
|
|
|
|
VALUE VARCHAR(1023) NOT NULL,
|
|
|
|
|
CONSTRAINT CM_CONSENT_RECEIPT_PROPERTY_CNT UNIQUE (CONSENT_RECEIPT_ID, NAME),
|
|
|
|
|
FOREIGN KEY (CONSENT_RECEIPT_ID) REFERENCES CM_RECEIPT (CONSENT_RECEIPT_ID)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
INSERT INTO CM_PURPOSE (NAME, DESCRIPTION, TENANT_ID) values ('DEFAULT', 'For core functionalities of the product', '-1234');
|
|
|
|
|
|
|
|
|
|
INSERT INTO CM_PURPOSE_CATEGORY (NAME, DESCRIPTION, TENANT_ID) VALUES ('DEFAULT','For core functionalities of the product', '-1234');
|
|
|
|
|
|
|
|
|
|
-- End of CONSENT-MGT Tables --
|
|
|
|
|
|
|
|
|
|
-- Start of API-Mgt Tables --
|
|
|
|
|
|
|
|
|
|
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[AM_SUBSCRIBER]') AND TYPE IN (N'U'))
|
|
|
|
@ -716,7 +1051,7 @@ IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[A
|
|
|
|
|
|
|
|
|
|
CREATE TABLE AM_SUBSCRIPTION_KEY_MAPPING (
|
|
|
|
|
SUBSCRIPTION_ID INTEGER,
|
|
|
|
|
ACCESS_TOKEN VARCHAR(255),
|
|
|
|
|
ACCESS_TOKEN VARCHAR(512),
|
|
|
|
|
KEY_TYPE VARCHAR(512) NOT NULL,
|
|
|
|
|
FOREIGN KEY(SUBSCRIPTION_ID) REFERENCES AM_SUBSCRIPTION(SUBSCRIPTION_ID) ON UPDATE CASCADE,
|
|
|
|
|
PRIMARY KEY(SUBSCRIPTION_ID,ACCESS_TOKEN)
|
|
|
|
@ -742,7 +1077,7 @@ CREATE TABLE AM_APPLICATION_REGISTRATION (
|
|
|
|
|
WF_REF VARCHAR(255) NOT NULL,
|
|
|
|
|
APP_ID INTEGER,
|
|
|
|
|
TOKEN_TYPE VARCHAR(30),
|
|
|
|
|
TOKEN_SCOPE VARCHAR(256) DEFAULT 'default',
|
|
|
|
|
TOKEN_SCOPE VARCHAR(1500) DEFAULT 'default',
|
|
|
|
|
INPUTS VARCHAR(1000),
|
|
|
|
|
ALLOWED_DOMAINS VARCHAR(256),
|
|
|
|
|
VALIDITY_PERIOD BIGINT,
|
|
|
|
@ -1072,7 +1407,7 @@ IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[A
|
|
|
|
|
CREATE TABLE AM_BLOCK_CONDITIONS (
|
|
|
|
|
CONDITION_ID INTEGER IDENTITY(1,1),
|
|
|
|
|
TYPE varchar(45) DEFAULT NULL,
|
|
|
|
|
VALUE varchar(45) DEFAULT NULL,
|
|
|
|
|
VALUE varchar(512) DEFAULT NULL,
|
|
|
|
|
ENABLED varchar(45) DEFAULT NULL,
|
|
|
|
|
DOMAIN varchar(45) DEFAULT NULL,
|
|
|
|
|
UUID VARCHAR(256),
|
|
|
|
@ -1080,13 +1415,49 @@ CREATE TABLE AM_BLOCK_CONDITIONS (
|
|
|
|
|
UNIQUE (UUID)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[AM_CERTIFICATE_METADATA]') AND TYPE IN (N'U'))
|
|
|
|
|
CREATE TABLE AM_CERTIFICATE_METADATA (
|
|
|
|
|
TENANT_ID INTEGER NOT NULL,
|
|
|
|
|
ALIAS VARCHAR(45) NOT NULL,
|
|
|
|
|
END_POINT VARCHAR(100) NOT NULL,
|
|
|
|
|
CONSTRAINT PK_ALIAS PRIMARY KEY (ALIAS),
|
|
|
|
|
CONSTRAINT END_POINT_CONSTRAINT UNIQUE (END_POINT)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[AM_APPLICATION_GROUP_MAPPING]') AND TYPE IN (N'U'))
|
|
|
|
|
CREATE TABLE AM_APPLICATION_GROUP_MAPPING (
|
|
|
|
|
APPLICATION_ID INTEGER NOT NULL,
|
|
|
|
|
GROUP_ID VARCHAR(512),
|
|
|
|
|
TENANT VARCHAR(255),
|
|
|
|
|
PRIMARY KEY (APPLICATION_ID,GROUP_ID,TENANT),
|
|
|
|
|
FOREIGN KEY (APPLICATION_ID) REFERENCES AM_APPLICATION(APPLICATION_ID) ON DELETE CASCADE ON UPDATE CASCADE
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[AM_USAGE_UPLOADED_FILES]') AND TYPE IN (N'U'))
|
|
|
|
|
CREATE TABLE AM_USAGE_UPLOADED_FILES (
|
|
|
|
|
TENANT_DOMAIN VARCHAR(255) NOT NULL,
|
|
|
|
|
FILE_NAME VARCHAR(255) NOT NULL,
|
|
|
|
|
FILE_TIMESTAMP DATETIME DEFAULT GETDATE(),
|
|
|
|
|
FILE_PROCESSED INTEGER DEFAULT 0,
|
|
|
|
|
FILE_CONTENT VARBINARY(MAX) DEFAULT NULL,
|
|
|
|
|
PRIMARY KEY (TENANT_DOMAIN, FILE_NAME, FILE_TIMESTAMP)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[AM_API_LC_PUBLISH_EVENTS]') AND TYPE IN (N'U'))
|
|
|
|
|
CREATE TABLE AM_API_LC_PUBLISH_EVENTS (
|
|
|
|
|
ID INTEGER NOT NULL IDENTITY,
|
|
|
|
|
TENANT_DOMAIN VARCHAR(255) NOT NULL,
|
|
|
|
|
API_ID VARCHAR(500) NOT NULL,
|
|
|
|
|
EVENT_TIME DATETIME DEFAULT GETDATE(),
|
|
|
|
|
PRIMARY KEY (ID)
|
|
|
|
|
);
|
|
|
|
|
-- End of API-MGT Tables --
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--Permance indexes start--
|
|
|
|
|
|
|
|
|
|
create index IDX_ITS_LMT on IDN_THRIFT_SESSION (LAST_MODIFIED_TIME);
|
|
|
|
|
create index IDX_IOAT_AT on IDN_OAUTH2_ACCESS_TOKEN (ACCESS_TOKEN);
|
|
|
|
|
create index IDX_IOAT_UT on IDN_OAUTH2_ACCESS_TOKEN (USER_TYPE);
|
|
|
|
|
create index IDX_AAI_CTX on AM_API (CONTEXT);
|
|
|
|
|
create index IDX_AAKM_CK on AM_APPLICATION_KEY_MAPPING (CONSUMER_KEY);
|
|
|
|
|