|
|
@ -69,7 +69,7 @@ CREATE TABLE IF NOT EXISTS DM_ENROLMENT (
|
|
|
|
DM_DEVICE (ID) ON DELETE NO ACTION ON UPDATE NO ACTION
|
|
|
|
DM_DEVICE (ID) ON DELETE NO ACTION ON UPDATE NO ACTION
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS DM_ENROLMENT_OPERATION_MAPPING (
|
|
|
|
CREATE TABLE IF NOT EXISTS DM_ENROLMENT_OP_MAPPING (
|
|
|
|
ID BIGSERIAL NOT NULL PRIMARY KEY,
|
|
|
|
ID BIGSERIAL NOT NULL PRIMARY KEY,
|
|
|
|
ENROLMENT_ID INTEGER NOT NULL,
|
|
|
|
ENROLMENT_ID INTEGER NOT NULL,
|
|
|
|
OPERATION_ID INTEGER NOT NULL,
|
|
|
|
OPERATION_ID INTEGER NOT NULL,
|
|
|
@ -93,7 +93,7 @@ CREATE TABLE IF NOT EXISTS DM_DEVICE_OPERATION_RESPONSE (
|
|
|
|
|
|
|
|
|
|
|
|
-- POLICY RELATED TABLES ---
|
|
|
|
-- POLICY RELATED TABLES ---
|
|
|
|
|
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS DM_PROFILE (
|
|
|
|
CREATE TABLE DM_PROFILE (
|
|
|
|
ID BIGSERIAL NOT NULL PRIMARY KEY,
|
|
|
|
ID BIGSERIAL NOT NULL PRIMARY KEY,
|
|
|
|
PROFILE_NAME VARCHAR(45) NOT NULL ,
|
|
|
|
PROFILE_NAME VARCHAR(45) NOT NULL ,
|
|
|
|
TENANT_ID INTEGER NOT NULL ,
|
|
|
|
TENANT_ID INTEGER NOT NULL ,
|
|
|
@ -107,8 +107,7 @@ CREATE TABLE IF NOT EXISTS DM_PROFILE (
|
|
|
|
ON UPDATE NO ACTION
|
|
|
|
ON UPDATE NO ACTION
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CREATE TABLE DM_POLICY (
|
|
|
|
CREATE TABLE IF NOT EXISTS DM_POLICY (
|
|
|
|
|
|
|
|
ID BIGSERIAL NOT NULL PRIMARY KEY,
|
|
|
|
ID BIGSERIAL NOT NULL PRIMARY KEY,
|
|
|
|
NAME VARCHAR(45) DEFAULT NULL ,
|
|
|
|
NAME VARCHAR(45) DEFAULT NULL ,
|
|
|
|
DESCRIPTION VARCHAR(1000) NULL,
|
|
|
|
DESCRIPTION VARCHAR(1000) NULL,
|
|
|
@ -126,7 +125,7 @@ CREATE TABLE IF NOT EXISTS DM_POLICY (
|
|
|
|
ON UPDATE NO ACTION
|
|
|
|
ON UPDATE NO ACTION
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS DM_DEVICE_POLICY (
|
|
|
|
CREATE TABLE DM_DEVICE_POLICY (
|
|
|
|
ID BIGSERIAL NOT NULL PRIMARY KEY,
|
|
|
|
ID BIGSERIAL NOT NULL PRIMARY KEY,
|
|
|
|
DEVICE_ID INTEGER NOT NULL ,
|
|
|
|
DEVICE_ID INTEGER NOT NULL ,
|
|
|
|
ENROLMENT_ID INTEGER NOT NULL,
|
|
|
|
ENROLMENT_ID INTEGER NOT NULL,
|
|
|
@ -144,7 +143,7 @@ CREATE TABLE IF NOT EXISTS DM_DEVICE_POLICY (
|
|
|
|
ON UPDATE NO ACTION
|
|
|
|
ON UPDATE NO ACTION
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS DM_DEVICE_TYPE_POLICY (
|
|
|
|
CREATE TABLE DM_DEVICE_TYPE_POLICY (
|
|
|
|
ID INTEGER NOT NULL,
|
|
|
|
ID INTEGER NOT NULL,
|
|
|
|
DEVICE_TYPE_ID INTEGER NOT NULL ,
|
|
|
|
DEVICE_TYPE_ID INTEGER NOT NULL ,
|
|
|
|
POLICY_ID INTEGER NOT NULL ,
|
|
|
|
POLICY_ID INTEGER NOT NULL ,
|
|
|
@ -161,7 +160,7 @@ CREATE TABLE IF NOT EXISTS DM_DEVICE_TYPE_POLICY (
|
|
|
|
ON UPDATE NO ACTION
|
|
|
|
ON UPDATE NO ACTION
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS DM_PROFILE_FEATURES (
|
|
|
|
CREATE TABLE DM_PROFILE_FEATURES (
|
|
|
|
ID BIGSERIAL NOT NULL PRIMARY KEY,
|
|
|
|
ID BIGSERIAL NOT NULL PRIMARY KEY,
|
|
|
|
PROFILE_ID INTEGER NOT NULL,
|
|
|
|
PROFILE_ID INTEGER NOT NULL,
|
|
|
|
FEATURE_CODE VARCHAR(30) NOT NULL,
|
|
|
|
FEATURE_CODE VARCHAR(30) NOT NULL,
|
|
|
@ -175,7 +174,7 @@ CREATE TABLE IF NOT EXISTS DM_PROFILE_FEATURES (
|
|
|
|
ON UPDATE NO ACTION
|
|
|
|
ON UPDATE NO ACTION
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS DM_ROLE_POLICY (
|
|
|
|
CREATE TABLE DM_ROLE_POLICY (
|
|
|
|
ID BIGSERIAL NOT NULL PRIMARY KEY,
|
|
|
|
ID BIGSERIAL NOT NULL PRIMARY KEY,
|
|
|
|
ROLE_NAME VARCHAR(45) NOT NULL ,
|
|
|
|
ROLE_NAME VARCHAR(45) NOT NULL ,
|
|
|
|
POLICY_ID INTEGER NOT NULL,
|
|
|
|
POLICY_ID INTEGER NOT NULL,
|
|
|
@ -186,7 +185,7 @@ CREATE TABLE IF NOT EXISTS DM_ROLE_POLICY (
|
|
|
|
ON UPDATE NO ACTION
|
|
|
|
ON UPDATE NO ACTION
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS DM_USER_POLICY (
|
|
|
|
CREATE TABLE DM_USER_POLICY (
|
|
|
|
ID BIGSERIAL NOT NULL PRIMARY KEY,
|
|
|
|
ID BIGSERIAL NOT NULL PRIMARY KEY,
|
|
|
|
POLICY_ID INT NOT NULL ,
|
|
|
|
POLICY_ID INT NOT NULL ,
|
|
|
|
USERNAME VARCHAR(45) NOT NULL,
|
|
|
|
USERNAME VARCHAR(45) NOT NULL,
|
|
|
@ -197,7 +196,7 @@ CREATE TABLE IF NOT EXISTS DM_USER_POLICY (
|
|
|
|
ON UPDATE NO ACTION
|
|
|
|
ON UPDATE NO ACTION
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS DM_DEVICE_POLICY_APPLIED (
|
|
|
|
CREATE TABLE DM_DEVICE_POLICY_APPLIED (
|
|
|
|
ID BIGSERIAL NOT NULL PRIMARY KEY,
|
|
|
|
ID BIGSERIAL NOT NULL PRIMARY KEY,
|
|
|
|
DEVICE_ID INTEGER NOT NULL ,
|
|
|
|
DEVICE_ID INTEGER NOT NULL ,
|
|
|
|
ENROLMENT_ID INTEGER NOT NULL,
|
|
|
|
ENROLMENT_ID INTEGER NOT NULL,
|
|
|
@ -256,7 +255,6 @@ CREATE TABLE IF NOT EXISTS DM_POLICY_CRITERIA_PROPERTIES (
|
|
|
|
);
|
|
|
|
);
|
|
|
|
COMMENT ON COLUMN DM_POLICY_CRITERIA_PROPERTIES.CONTENT IS 'This is used to ';
|
|
|
|
COMMENT ON COLUMN DM_POLICY_CRITERIA_PROPERTIES.CONTENT IS 'This is used to ';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS DM_POLICY_COMPLIANCE_STATUS (
|
|
|
|
CREATE TABLE IF NOT EXISTS DM_POLICY_COMPLIANCE_STATUS (
|
|
|
|
ID BIGSERIAL NOT NULL PRIMARY KEY,
|
|
|
|
ID BIGSERIAL NOT NULL PRIMARY KEY,
|
|
|
|
DEVICE_ID INTEGER NOT NULL,
|
|
|
|
DEVICE_ID INTEGER NOT NULL,
|
|
|
@ -276,7 +274,6 @@ CREATE TABLE IF NOT EXISTS DM_POLICY_COMPLIANCE_STATUS (
|
|
|
|
);
|
|
|
|
);
|
|
|
|
CREATE UNIQUE INDEX DEVICE_ID_UNIQUE ON DM_POLICY_COMPLIANCE_STATUS (DEVICE_ID ASC);
|
|
|
|
CREATE UNIQUE INDEX DEVICE_ID_UNIQUE ON DM_POLICY_COMPLIANCE_STATUS (DEVICE_ID ASC);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS DM_POLICY_CHANGE_MGT (
|
|
|
|
CREATE TABLE IF NOT EXISTS DM_POLICY_CHANGE_MGT (
|
|
|
|
ID BIGSERIAL NOT NULL PRIMARY KEY,
|
|
|
|
ID BIGSERIAL NOT NULL PRIMARY KEY,
|
|
|
|
POLICY_ID INTEGER NOT NULL,
|
|
|
|
POLICY_ID INTEGER NOT NULL,
|
|
|
@ -284,7 +281,6 @@ CREATE TABLE IF NOT EXISTS DM_POLICY_CHANGE_MGT (
|
|
|
|
TENANT_ID INTEGER NOT NULL
|
|
|
|
TENANT_ID INTEGER NOT NULL
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS DM_POLICY_COMPLIANCE_FEATURES (
|
|
|
|
CREATE TABLE IF NOT EXISTS DM_POLICY_COMPLIANCE_FEATURES (
|
|
|
|
ID BIGSERIAL NOT NULL PRIMARY KEY,
|
|
|
|
ID BIGSERIAL NOT NULL PRIMARY KEY,
|
|
|
|
COMPLIANCE_STATUS_ID INTEGER NOT NULL,
|
|
|
|
COMPLIANCE_STATUS_ID INTEGER NOT NULL,
|
|
|
@ -298,7 +294,6 @@ CREATE TABLE IF NOT EXISTS DM_POLICY_COMPLIANCE_FEATURES (
|
|
|
|
ON UPDATE NO ACTION
|
|
|
|
ON UPDATE NO ACTION
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS DM_ENROLMENT (
|
|
|
|
CREATE TABLE IF NOT EXISTS DM_ENROLMENT (
|
|
|
|
ID BIGSERIAL NOT NULL PRIMARY KEY,
|
|
|
|
ID BIGSERIAL NOT NULL PRIMARY KEY,
|
|
|
|
DEVICE_ID INTEGER NOT NULL,
|
|
|
|
DEVICE_ID INTEGER NOT NULL,
|
|
|
@ -312,7 +307,6 @@ CREATE TABLE IF NOT EXISTS DM_ENROLMENT (
|
|
|
|
DM_DEVICE (ID) ON DELETE NO ACTION ON UPDATE NO ACTION
|
|
|
|
DM_DEVICE (ID) ON DELETE NO ACTION ON UPDATE NO ACTION
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS DM_APPLICATION (
|
|
|
|
CREATE TABLE IF NOT EXISTS DM_APPLICATION (
|
|
|
|
ID BIGSERIAL NOT NULL PRIMARY KEY,
|
|
|
|
ID BIGSERIAL NOT NULL PRIMARY KEY,
|
|
|
|
NAME VARCHAR(50) NOT NULL,
|
|
|
|
NAME VARCHAR(50) NOT NULL,
|
|
|
@ -342,8 +336,5 @@ CREATE TABLE IF NOT EXISTS DM_NOTIFICATION (
|
|
|
|
CONSTRAINT fk_dm_operation_notification FOREIGN KEY (OPERATION_ID) REFERENCES
|
|
|
|
CONSTRAINT fk_dm_operation_notification FOREIGN KEY (OPERATION_ID) REFERENCES
|
|
|
|
DM_OPERATION (ID) ON DELETE NO ACTION ON UPDATE NO ACTION
|
|
|
|
DM_OPERATION (ID) ON DELETE NO ACTION ON UPDATE NO ACTION
|
|
|
|
);
|
|
|
|
);
|
|
|
|
-- NOTIFICATION TABLE END --
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- TO:DO - Remove this INSERT sql statement.
|
|
|
|
-- NOTIFICATION TABLE END --
|
|
|
|
Insert into DM_DEVICE_TYPE (ID,NAME) VALUES (1, 'android');
|
|
|
|
|
|
|
|
Insert into DM_DEVICE_TYPE (ID,NAME) VALUES (2, 'ios');
|
|
|
|
|
|
|
|