|
|
@ -1,5 +1,5 @@
|
|
|
|
CREATE TABLE IF NOT EXISTS DM_DEVICE_TYPE (
|
|
|
|
CREATE TABLE IF NOT EXISTS DM_DEVICE_TYPE (
|
|
|
|
ID INT AUTO_INCREMENT NOT NULL,
|
|
|
|
ID INT auto_increment NOT NULL,
|
|
|
|
NAME VARCHAR(300) DEFAULT NULL,
|
|
|
|
NAME VARCHAR(300) DEFAULT NULL,
|
|
|
|
PRIMARY KEY (ID)
|
|
|
|
PRIMARY KEY (ID)
|
|
|
|
);
|
|
|
|
);
|
|
|
@ -16,7 +16,7 @@ CREATE TABLE IF NOT EXISTS DM_GROUP (
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS DM_DEVICE_CERTIFICATE (
|
|
|
|
CREATE TABLE IF NOT EXISTS DM_DEVICE_CERTIFICATE (
|
|
|
|
ID INTEGER AUTO_INCREMENT NOT NULL,
|
|
|
|
ID INTEGER auto_increment NOT NULL,
|
|
|
|
SERIAL_NUMBER VARCHAR(500) DEFAULT NULL,
|
|
|
|
SERIAL_NUMBER VARCHAR(500) DEFAULT NULL,
|
|
|
|
CERTIFICATE BLOB DEFAULT NULL,
|
|
|
|
CERTIFICATE BLOB DEFAULT NULL,
|
|
|
|
TENANT_ID INTEGER DEFAULT 0,
|
|
|
|
TENANT_ID INTEGER DEFAULT 0,
|
|
|
@ -24,7 +24,7 @@ CREATE TABLE IF NOT EXISTS DM_DEVICE_CERTIFICATE (
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS DM_DEVICE (
|
|
|
|
CREATE TABLE IF NOT EXISTS DM_DEVICE (
|
|
|
|
ID INTEGER AUTO_INCREMENT NOT NULL,
|
|
|
|
ID INTEGER auto_increment NOT NULL,
|
|
|
|
DESCRIPTION TEXT DEFAULT NULL,
|
|
|
|
DESCRIPTION TEXT DEFAULT NULL,
|
|
|
|
NAME VARCHAR(100) DEFAULT NULL,
|
|
|
|
NAME VARCHAR(100) DEFAULT NULL,
|
|
|
|
DEVICE_TYPE_ID INT(11) DEFAULT NULL,
|
|
|
|
DEVICE_TYPE_ID INT(11) DEFAULT NULL,
|
|
|
@ -145,6 +145,10 @@ CREATE TABLE IF NOT EXISTS DM_PROFILE (
|
|
|
|
ON UPDATE NO ACTION
|
|
|
|
ON UPDATE NO ACTION
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS DM_POLICY (
|
|
|
|
CREATE TABLE IF NOT EXISTS DM_POLICY (
|
|
|
|
ID INT(11) NOT NULL AUTO_INCREMENT ,
|
|
|
|
ID INT(11) NOT NULL AUTO_INCREMENT ,
|
|
|
|
NAME VARCHAR(45) DEFAULT NULL ,
|
|
|
|
NAME VARCHAR(45) DEFAULT NULL ,
|
|
|
@ -164,6 +168,9 @@ 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 IF NOT EXISTS DM_DEVICE_POLICY (
|
|
|
|
ID INT(11) NOT NULL AUTO_INCREMENT ,
|
|
|
|
ID INT(11) NOT NULL AUTO_INCREMENT ,
|
|
|
|
DEVICE_ID INT(11) NOT NULL ,
|
|
|
|
DEVICE_ID INT(11) NOT NULL ,
|
|
|
@ -183,6 +190,9 @@ 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 IF NOT EXISTS DM_DEVICE_TYPE_POLICY (
|
|
|
|
ID INT(11) NOT NULL ,
|
|
|
|
ID INT(11) NOT NULL ,
|
|
|
|
DEVICE_TYPE_ID INT(11) NOT NULL ,
|
|
|
|
DEVICE_TYPE_ID INT(11) NOT NULL ,
|
|
|
@ -200,6 +210,10 @@ 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 IF NOT EXISTS DM_PROFILE_FEATURES (
|
|
|
|
ID INT(11) NOT NULL AUTO_INCREMENT,
|
|
|
|
ID INT(11) NOT NULL AUTO_INCREMENT,
|
|
|
|
PROFILE_ID INT(11) NOT NULL,
|
|
|
|
PROFILE_ID INT(11) NOT NULL,
|
|
|
@ -215,6 +229,9 @@ 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 IF NOT EXISTS DM_ROLE_POLICY (
|
|
|
|
ID INT(11) NOT NULL AUTO_INCREMENT ,
|
|
|
|
ID INT(11) NOT NULL AUTO_INCREMENT ,
|
|
|
|
ROLE_NAME VARCHAR(45) NOT NULL ,
|
|
|
|
ROLE_NAME VARCHAR(45) NOT NULL ,
|
|
|
@ -227,6 +244,9 @@ 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 IF NOT EXISTS DM_USER_POLICY (
|
|
|
|
ID INT NOT NULL AUTO_INCREMENT ,
|
|
|
|
ID INT NOT NULL AUTO_INCREMENT ,
|
|
|
|
POLICY_ID INT NOT NULL ,
|
|
|
|
POLICY_ID INT NOT NULL ,
|
|
|
@ -239,6 +259,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 IF NOT EXISTS DM_DEVICE_POLICY_APPLIED (
|
|
|
|
ID INT NOT NULL AUTO_INCREMENT ,
|
|
|
|
ID INT NOT NULL AUTO_INCREMENT ,
|
|
|
|
DEVICE_ID INT NOT NULL ,
|
|
|
|
DEVICE_ID INT NOT NULL ,
|
|
|
@ -246,18 +267,20 @@ CREATE TABLE IF NOT EXISTS DM_DEVICE_POLICY_APPLIED (
|
|
|
|
POLICY_ID INT NOT NULL ,
|
|
|
|
POLICY_ID INT NOT NULL ,
|
|
|
|
POLICY_CONTENT BLOB NULL ,
|
|
|
|
POLICY_CONTENT BLOB NULL ,
|
|
|
|
TENANT_ID INT NOT NULL,
|
|
|
|
TENANT_ID INT NOT NULL,
|
|
|
|
APPLIED BOOLEAN NULL,
|
|
|
|
APPLIED TINYINT(1) NULL ,
|
|
|
|
CREATED_TIME TIMESTAMP NULL ,
|
|
|
|
CREATED_TIME TIMESTAMP NULL ,
|
|
|
|
UPDATED_TIME TIMESTAMP NULL ,
|
|
|
|
UPDATED_TIME TIMESTAMP NULL ,
|
|
|
|
APPLIED_TIME TIMESTAMP NULL ,
|
|
|
|
APPLIED_TIME TIMESTAMP NULL ,
|
|
|
|
PRIMARY KEY (ID) ,
|
|
|
|
PRIMARY KEY (ID) ,
|
|
|
|
CONSTRAINT FK_DM_POLICY_DEVICE_APPLIED
|
|
|
|
CONSTRAINT FK_DM_POLICY_DEVCIE_APPLIED
|
|
|
|
FOREIGN KEY (DEVICE_ID )
|
|
|
|
FOREIGN KEY (DEVICE_ID )
|
|
|
|
REFERENCES DM_DEVICE (ID )
|
|
|
|
REFERENCES DM_DEVICE (ID )
|
|
|
|
ON DELETE NO ACTION
|
|
|
|
ON DELETE NO ACTION
|
|
|
|
ON UPDATE NO ACTION
|
|
|
|
ON UPDATE NO ACTION
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS DM_CRITERIA (
|
|
|
|
CREATE TABLE IF NOT EXISTS DM_CRITERIA (
|
|
|
|
ID INT NOT NULL AUTO_INCREMENT,
|
|
|
|
ID INT NOT NULL AUTO_INCREMENT,
|
|
|
|
TENANT_ID INT NOT NULL,
|
|
|
|
TENANT_ID INT NOT NULL,
|
|
|
@ -265,6 +288,8 @@ CREATE TABLE IF NOT EXISTS DM_CRITERIA (
|
|
|
|
PRIMARY KEY (ID)
|
|
|
|
PRIMARY KEY (ID)
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS DM_POLICY_CRITERIA (
|
|
|
|
CREATE TABLE IF NOT EXISTS DM_POLICY_CRITERIA (
|
|
|
|
ID INT NOT NULL AUTO_INCREMENT,
|
|
|
|
ID INT NOT NULL AUTO_INCREMENT,
|
|
|
|
CRITERIA_ID INT NOT NULL,
|
|
|
|
CRITERIA_ID INT NOT NULL,
|
|
|
@ -287,8 +312,7 @@ CREATE TABLE IF NOT EXISTS DM_POLICY_CRITERIA_PROPERTIES (
|
|
|
|
POLICY_CRITERION_ID INT NOT NULL,
|
|
|
|
POLICY_CRITERION_ID INT NOT NULL,
|
|
|
|
PROP_KEY VARCHAR(45) NULL,
|
|
|
|
PROP_KEY VARCHAR(45) NULL,
|
|
|
|
PROP_VALUE VARCHAR(100) NULL,
|
|
|
|
PROP_VALUE VARCHAR(100) NULL,
|
|
|
|
CONTENT BLOB NULL
|
|
|
|
CONTENT BLOB NULL COMMENT 'This is used to ',
|
|
|
|
COMMENT 'This is used to ',
|
|
|
|
|
|
|
|
PRIMARY KEY (ID),
|
|
|
|
PRIMARY KEY (ID),
|
|
|
|
CONSTRAINT FK_POLICY_CRITERIA_PROPERTIES
|
|
|
|
CONSTRAINT FK_POLICY_CRITERIA_PROPERTIES
|
|
|
|
FOREIGN KEY (POLICY_CRITERION_ID)
|
|
|
|
FOREIGN KEY (POLICY_CRITERION_ID)
|
|
|
@ -360,6 +384,7 @@ CREATE TABLE IF NOT EXISTS DM_APPLICATION (
|
|
|
|
LOCATION_URL VARCHAR(100) DEFAULT NULL,
|
|
|
|
LOCATION_URL VARCHAR(100) DEFAULT NULL,
|
|
|
|
IMAGE_URL VARCHAR(100) DEFAULT NULL,
|
|
|
|
IMAGE_URL VARCHAR(100) DEFAULT NULL,
|
|
|
|
APP_PROPERTIES BLOB NULL,
|
|
|
|
APP_PROPERTIES BLOB NULL,
|
|
|
|
|
|
|
|
MEMORY_USAGE INTEGER(10) NULL,
|
|
|
|
TENANT_ID INTEGER NOT NULL,
|
|
|
|
TENANT_ID INTEGER NOT NULL,
|
|
|
|
PRIMARY KEY (ID)
|
|
|
|
PRIMARY KEY (ID)
|
|
|
|
);
|
|
|
|
);
|
|
|
@ -409,6 +434,8 @@ CREATE TABLE IF NOT EXISTS DM_DEVICE_INFO (
|
|
|
|
ON UPDATE NO ACTION
|
|
|
|
ON UPDATE NO ACTION
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DROP TABLE IF EXISTS DM_DEVICE_LOCATION;
|
|
|
|
DROP TABLE IF EXISTS DM_DEVICE_LOCATION;
|
|
|
|
|
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS DM_DEVICE_LOCATION (
|
|
|
|
CREATE TABLE IF NOT EXISTS DM_DEVICE_LOCATION (
|
|
|
@ -430,6 +457,7 @@ CREATE TABLE IF NOT EXISTS DM_DEVICE_LOCATION (
|
|
|
|
ON UPDATE NO ACTION
|
|
|
|
ON UPDATE NO ACTION
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS DM_DEVICE_DETAIL (
|
|
|
|
CREATE TABLE IF NOT EXISTS DM_DEVICE_DETAIL (
|
|
|
|
ID INT NOT NULL AUTO_INCREMENT,
|
|
|
|
ID INT NOT NULL AUTO_INCREMENT,
|
|
|
|
DEVICE_ID INT NOT NULL,
|
|
|
|
DEVICE_ID INT NOT NULL,
|
|
|
|