|
|
|
@ -295,6 +295,51 @@ CREATE TABLE IF NOT EXISTS DM_POLICY_CRITERIA_PROPERTIES (
|
|
|
|
|
ON UPDATE NO ACTION
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS DM_POLICY_COMPLIANCE_STATUS (
|
|
|
|
|
ID INT NOT NULL AUTO_INCREMENT,
|
|
|
|
|
DEVICE_ID INT NOT NULL,
|
|
|
|
|
POLICY_ID INT NOT NULL,
|
|
|
|
|
STATUS INT NULL,
|
|
|
|
|
LAST_SUCCESS_TIME TIMESTAMP NULL,
|
|
|
|
|
LAST_REQUESTED_TIME TIMESTAMP NULL,
|
|
|
|
|
LAST_FAILED_TIME TIMESTAMP NULL,
|
|
|
|
|
ATTEMPTS INT NULL,
|
|
|
|
|
PRIMARY KEY (ID),
|
|
|
|
|
CONSTRAINT FK_POLICY_COMPLIANCE_STATUS_POLICY
|
|
|
|
|
FOREIGN KEY (POLICY_ID)
|
|
|
|
|
REFERENCES DM_POLICY (ID)
|
|
|
|
|
ON DELETE NO ACTION
|
|
|
|
|
ON UPDATE NO ACTION
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS DM_POLICY_COMPLIANCE_FEATURES (
|
|
|
|
|
ID INT NOT NULL AUTO_INCREMENT,
|
|
|
|
|
COMPLIANCE_STATUS_ID INT NOT NULL,
|
|
|
|
|
FEATURE_CODE INT NOT NULL,
|
|
|
|
|
STATUS INT NULL,
|
|
|
|
|
PRIMARY KEY (ID),
|
|
|
|
|
CONSTRAINT FK_COMPLIANCE_FEATURES_STATUS
|
|
|
|
|
FOREIGN KEY (COMPLIANCE_STATUS_ID)
|
|
|
|
|
REFERENCES DM_POLICY_COMPLIANCE_STATUS (ID)
|
|
|
|
|
ON DELETE NO ACTION
|
|
|
|
|
ON UPDATE NO ACTION
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS DM_ENROLMENT (
|
|
|
|
|
ID INTEGER AUTO_INCREMENT NOT NULL,
|
|
|
|
|
DEVICE_ID INTEGER NOT NULL,
|
|
|
|
|
OWNER VARCHAR(50) NOT NULL,
|
|
|
|
|
OWNERSHIP VARCHAR(45) NULL DEFAULT NULL,
|
|
|
|
|
STATUS VARCHAR(50) NULL,
|
|
|
|
|
DATE_OF_ENROLMENT TIMESTAMP NULL DEFAULT NULL,
|
|
|
|
|
DATE_OF_LAST_UPDATE TIMESTAMP NULL DEFAULT NULL,
|
|
|
|
|
TENANT_ID INT NOT NULL,
|
|
|
|
|
PRIMARY KEY (ID),
|
|
|
|
|
CONSTRAINT fk_dm_device_enrolment FOREIGN KEY (DEVICE_ID) REFERENCES
|
|
|
|
|
DM_DEVICE (ID) ON DELETE NO ACTION ON UPDATE NO ACTION
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS DM_APPLICATION (
|
|
|
|
|
ID INTEGER AUTO_INCREMENT NOT NULL,
|
|
|
|
|
NAME VARCHAR(50) NOT NULL,
|
|
|
|
@ -322,36 +367,6 @@ CREATE TABLE IF NOT EXISTS DM_DEVICE_APPLICATION_MAPPING (
|
|
|
|
|
DM_APPLICATION (ID) ON DELETE NO ACTION ON UPDATE NO ACTION
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS DM_POLICY_COMPLIANCE_STATUS (
|
|
|
|
|
ID INT NOT NULL AUTO_INCREMENT,
|
|
|
|
|
DEVICE_ID INT NOT NULL,
|
|
|
|
|
POLICY_ID INT NOT NULL,
|
|
|
|
|
STATUS INT NULL,
|
|
|
|
|
LAST_SUCCESS_TIME TIMESTAMP NULL,
|
|
|
|
|
LAST_REQUESTED_TIME TIMESTAMP NULL,
|
|
|
|
|
LAST_FAILED_TIME TIMESTAMP NULL,
|
|
|
|
|
ATTEMPTS INT NULL,
|
|
|
|
|
PRIMARY KEY (ID),
|
|
|
|
|
CONSTRAINT FK_POLICY_COMPLIANCE_STATUS_POLICY
|
|
|
|
|
FOREIGN KEY (POLICY_ID)
|
|
|
|
|
REFERENCES DM_POLICY (ID)
|
|
|
|
|
ON DELETE NO ACTION
|
|
|
|
|
ON UPDATE NO ACTION
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS DM_POLICY_COMPLIANCE_FEATURES (
|
|
|
|
|
ID INT NOT NULL AUTO_INCREMENT,
|
|
|
|
|
COMPLIANCE_STATUS_ID INT NOT NULL,
|
|
|
|
|
FEATURE_CODE INT NOT NULL,
|
|
|
|
|
STATUS INT NULL,
|
|
|
|
|
PRIMARY KEY (ID),
|
|
|
|
|
CONSTRAINT FK_COMPLIANCE_FEATURES_STATUS
|
|
|
|
|
FOREIGN KEY (COMPLIANCE_STATUS_ID)
|
|
|
|
|
REFERENCES DM_POLICY_COMPLIANCE_STATUS (ID)
|
|
|
|
|
ON DELETE NO ACTION
|
|
|
|
|
ON UPDATE NO ACTION
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
-- POLICY RELATED TABLES FINISHED --
|
|
|
|
|
|
|
|
|
|