Fixed EMM-1449 issue

revert-70aa11f8
harshanl 9 years ago
parent b8bf855378
commit 03835bdeb7

@ -134,7 +134,7 @@ CREATE TABLE IF NOT EXISTS DM_PROFILE (
ID INT NOT NULL AUTO_INCREMENT ,
PROFILE_NAME VARCHAR(45) NOT NULL ,
TENANT_ID INT NOT NULL ,
DEVICE_TYPE VARCHAR(20) NOT NULL ,
DEVICE_TYPE VARCHAR(300) NOT NULL ,
CREATED_TIME DATETIME NOT NULL ,
UPDATED_TIME DATETIME NOT NULL ,
PRIMARY KEY (ID) ,
@ -195,7 +195,7 @@ CREATE TABLE IF NOT EXISTS DM_DEVICE_POLICY (
CREATE TABLE IF NOT EXISTS DM_DEVICE_TYPE_POLICY (
ID INT(11) NOT NULL ,
DEVICE_TYPE VARCHAR(20) NOT NULL ,
DEVICE_TYPE VARCHAR(300) NOT NULL ,
POLICY_ID INT(11) NOT NULL ,
PRIMARY KEY (ID) ,
CONSTRAINT FK_DEVICE_TYPE_POLICY
@ -218,7 +218,7 @@ CREATE TABLE IF NOT EXISTS DM_PROFILE_FEATURES (
ID INT(11) NOT NULL AUTO_INCREMENT,
PROFILE_ID INT(11) NOT NULL,
FEATURE_CODE VARCHAR(100) NOT NULL,
DEVICE_TYPE VARCHAR(20) NOT NULL,
DEVICE_TYPE VARCHAR(300) NOT NULL,
TENANT_ID INT(11) NOT NULL ,
CONTENT BLOB NULL DEFAULT NULL,
PRIMARY KEY (ID),
@ -339,7 +339,7 @@ CREATE TABLE IF NOT EXISTS DM_POLICY_COMPLIANCE_STATUS (
CREATE TABLE IF NOT EXISTS DM_POLICY_CHANGE_MGT (
ID INT NOT NULL AUTO_INCREMENT,
POLICY_ID INT NOT NULL,
DEVICE_TYPE VARCHAR(20) NOT NULL,
DEVICE_TYPE VARCHAR(300) NOT NULL ,
TENANT_ID INT(11) NOT NULL,
PRIMARY KEY (ID)
);

@ -135,13 +135,13 @@ CREATE TABLE DM_PROFILE (
ID INTEGER NOT NULL IDENTITY ,
PROFILE_NAME VARCHAR(45) NOT NULL ,
TENANT_ID INTEGER NOT NULL ,
DEVICE_TYPE_ID INTEGER NOT NULL ,
DEVICE_TYPE VARCHAR(300) NOT NULL ,
CREATED_TIME DATETIME2(0) NOT NULL ,
UPDATED_TIME DATETIME2(0) NOT NULL ,
PRIMARY KEY (ID) ,
CONSTRAINT DM_PROFILE_DEVICE_TYPE
FOREIGN KEY (DEVICE_TYPE_ID )
REFERENCES DM_DEVICE_TYPE (ID )
FOREIGN KEY (DEVICE_TYPE)
REFERENCES DM_DEVICE_TYPE (NAME )
ON DELETE NO ACTION
ON UPDATE NO ACTION
);
@ -196,7 +196,7 @@ CREATE TABLE DM_DEVICE_POLICY (
CREATE TABLE DM_DEVICE_TYPE_POLICY (
ID INTEGER NOT NULL ,
DEVICE_TYPE_ID INTEGER NOT NULL ,
DEVICE_TYPE VARCHAR(300) NOT NULL ,
POLICY_ID INTEGER NOT NULL ,
PRIMARY KEY (ID) ,
CONSTRAINT FK_DEVICE_TYPE_POLICY
@ -205,8 +205,8 @@ CREATE TABLE DM_DEVICE_TYPE_POLICY (
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT FK_DEVICE_TYPE_POLICY_DEVICE_TYPE
FOREIGN KEY (DEVICE_TYPE_ID )
REFERENCES DM_DEVICE_TYPE (ID )
FOREIGN KEY (DEVICE_TYPE)
REFERENCES DM_DEVICE_TYPE (NAME )
ON DELETE NO ACTION
ON UPDATE NO ACTION
);
@ -219,7 +219,7 @@ CREATE TABLE DM_PROFILE_FEATURES (
ID INTEGER NOT NULL IDENTITY,
PROFILE_ID INTEGER NOT NULL,
FEATURE_CODE VARCHAR(100) NOT NULL,
DEVICE_TYPE_ID INTEGER NOT NULL,
DEVICE_TYPE VARCHAR(300) NOT NULL ,
TENANT_ID INTEGER NOT NULL ,
CONTENT VARBINARY(max) NULL DEFAULT NULL,
PRIMARY KEY (ID),
@ -340,7 +340,7 @@ CREATE TABLE DM_POLICY_COMPLIANCE_STATUS (
CREATE TABLE DM_POLICY_CHANGE_MGT (
ID INTEGER NOT NULL IDENTITY,
POLICY_ID INTEGER NOT NULL,
DEVICE_TYPE_ID INTEGER NOT NULL,
DEVICE_TYPE VARCHAR(300) NOT NULL,
TENANT_ID INTEGER NOT NULL,
PRIMARY KEY (ID)
);

@ -5,6 +5,7 @@ CREATE TABLE IF NOT EXISTS DM_DEVICE_TYPE (
SHARED_WITH_ALL_TENANTS BOOLEAN NOT NULL DEFAULT FALSE,
PRIMARY KEY (ID)
)ENGINE = InnoDB;
CREATE INDEX device_type_name ON DM_DEVICE_TYPE (NAME);
CREATE TABLE IF NOT EXISTS DM_DEVICE (
ID INTEGER AUTO_INCREMENT NOT NULL,
@ -117,13 +118,13 @@ CREATE TABLE IF NOT EXISTS DM_PROFILE (
ID INT NOT NULL AUTO_INCREMENT ,
PROFILE_NAME VARCHAR(45) NOT NULL ,
TENANT_ID INT NOT NULL ,
DEVICE_TYPE_ID INT NOT NULL ,
DEVICE_TYPE VARCHAR(300) NOT NULL ,
CREATED_TIME DATETIME NOT NULL ,
UPDATED_TIME DATETIME NOT NULL ,
PRIMARY KEY (ID) ,
CONSTRAINT DM_PROFILE_DEVICE_TYPE
FOREIGN KEY (DEVICE_TYPE_ID )
REFERENCES DM_DEVICE_TYPE (ID )
FOREIGN KEY (DEVICE_TYPE)
REFERENCES DM_DEVICE_TYPE (NAME)
ON DELETE NO ACTION
ON UPDATE NO ACTION
)ENGINE = InnoDB;
@ -171,7 +172,7 @@ CREATE TABLE IF NOT EXISTS DM_DEVICE_POLICY (
CREATE TABLE IF NOT EXISTS DM_DEVICE_TYPE_POLICY (
ID INT(11) NOT NULL ,
DEVICE_TYPE_ID INT(11) NOT NULL ,
DEVICE_TYPE VARCHAR(300) NOT NULL ,
POLICY_ID INT(11) NOT NULL ,
PRIMARY KEY (ID) ,
CONSTRAINT FK_DEVICE_TYPE_POLICY
@ -180,8 +181,8 @@ CREATE TABLE IF NOT EXISTS DM_DEVICE_TYPE_POLICY (
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT FK_DEVICE_TYPE_POLICY_DEVICE_TYPE
FOREIGN KEY (DEVICE_TYPE_ID )
REFERENCES DM_DEVICE_TYPE (ID )
FOREIGN KEY (DEVICE_TYPE )
REFERENCES DM_DEVICE_TYPE (NAME )
ON DELETE NO ACTION
ON UPDATE NO ACTION
)ENGINE = InnoDB;
@ -191,7 +192,7 @@ CREATE TABLE IF NOT EXISTS DM_PROFILE_FEATURES (
ID INT(11) NOT NULL AUTO_INCREMENT,
PROFILE_ID INT(11) NOT NULL,
FEATURE_CODE VARCHAR(100) NOT NULL,
DEVICE_TYPE_ID INT NOT NULL,
DEVICE_TYPE VARCHAR(300) NOT NULL ,
TENANT_ID INT(11) NOT NULL ,
CONTENT BLOB NULL DEFAULT NULL,
PRIMARY KEY (ID),
@ -308,7 +309,7 @@ CREATE TABLE IF NOT EXISTS DM_POLICY_COMPLIANCE_STATUS (
CREATE TABLE IF NOT EXISTS DM_POLICY_CHANGE_MGT (
ID INT NOT NULL AUTO_INCREMENT,
POLICY_ID INT NOT NULL,
DEVICE_TYPE_ID INT NOT NULL,
DEVICE_TYPE VARCHAR(300) NOT NULL ,
TENANT_ID INT(11) NOT NULL,
PRIMARY KEY (ID)
)ENGINE = InnoDB;

@ -250,13 +250,13 @@ CREATE TABLE DM_PROFILE (
ID NUMBER(10) NOT NULL ,
PROFILE_NAME VARCHAR2(45) NOT NULL ,
TENANT_ID NUMBER(10) NOT NULL ,
DEVICE_TYPE_ID NUMBER(10) NOT NULL ,
DEVICE_TYPE VARCHAR2(300) NOT NULL ,
CREATED_TIME TIMESTAMP(0) NOT NULL ,
UPDATED_TIME TIMESTAMP(0) NOT NULL ,
CONSTRAINT PK_DM_PROFILE PRIMARY KEY (ID) ,
CONSTRAINT DM_PROFILE_DEVICE_TYPE
FOREIGN KEY (DEVICE_TYPE_ID )
REFERENCES DM_DEVICE_TYPE (ID )
FOREIGN KEY (DEVICE_TYPE )
REFERENCES DM_DEVICE_TYPE (NAME )
)
/
-- Generate ID using sequence and trigger
@ -338,15 +338,15 @@ WHEN (NEW.ID IS NULL)
CREATE TABLE DM_DEVICE_TYPE_POLICY (
ID NUMBER(10) NOT NULL ,
DEVICE_TYPE_ID NUMBER(10) NOT NULL ,
DEVICE_TYPE VARCHAR2(300) NOT NULL ,
POLICY_ID NUMBER(10) NOT NULL ,
CONSTRAINT PK_DEV_TYPE_POLICY PRIMARY KEY (ID) ,
CONSTRAINT FK_DEV_TYPE_POLICY
FOREIGN KEY (POLICY_ID )
REFERENCES DM_POLICY (ID ),
CONSTRAINT FK_DEV_TYPE_POLICY_DEV_TYPE
FOREIGN KEY (DEVICE_TYPE_ID )
REFERENCES DM_DEVICE_TYPE (ID )
FOREIGN KEY (DEVICE_TYPE )
REFERENCES DM_DEVICE_TYPE (NAME )
)
/
@ -355,7 +355,7 @@ CREATE TABLE DM_PROFILE_FEATURES (
ID NUMBER(10) NOT NULL,
PROFILE_ID NUMBER(10) NOT NULL,
FEATURE_CODE VARCHAR2(100) NOT NULL,
DEVICE_TYPE_ID NUMBER(10) NOT NULL,
DEVICE_TYPE VARCHAR2(300) NOT NULL ,
TENANT_ID NUMBER(10) NOT NULL ,
CONTENT BLOB DEFAULT NULL NULL,
CONSTRAINT PK_DM_PROF_DM_POLICY_FEATURES PRIMARY KEY (ID),
@ -566,7 +566,7 @@ WHEN (NEW.ID IS NULL)
CREATE TABLE DM_POLICY_CHANGE_MGT (
ID NUMBER(10) NOT NULL,
POLICY_ID NUMBER(10) NOT NULL,
DEVICE_TYPE_ID NUMBER(10) NOT NULL,
DEVICE_TYPE VARCHAR2(300) NOT NULL,
TENANT_ID NUMBER(10) NOT NULL,
CONSTRAINT PK_DM_POLICY_CHANGE_MGT PRIMARY KEY (ID)
)

@ -103,12 +103,12 @@ CREATE TABLE IF NOT EXISTS DM_PROFILE (
ID BIGSERIAL NOT NULL PRIMARY KEY,
PROFILE_NAME VARCHAR(45) NOT NULL ,
TENANT_ID INTEGER NOT NULL ,
DEVICE_TYPE_ID INTEGER NOT NULL ,
DEVICE_TYPE VARCHAR(300) NOT NULL ,
CREATED_TIME TIMESTAMP NOT NULL ,
UPDATED_TIME TIMESTAMP NOT NULL ,
CONSTRAINT DM_PROFILE_DEVICE_TYPE
FOREIGN KEY (DEVICE_TYPE_ID )
REFERENCES DM_DEVICE_TYPE (ID )
FOREIGN KEY (DEVICE_TYPE )
REFERENCES DM_DEVICE_TYPE (NAME )
ON DELETE NO ACTION
ON UPDATE NO ACTION
);
@ -151,7 +151,7 @@ CREATE TABLE IF NOT EXISTS DM_DEVICE_POLICY (
CREATE TABLE IF NOT EXISTS DM_DEVICE_TYPE_POLICY (
ID INTEGER NOT NULL,
DEVICE_TYPE_ID INTEGER NOT NULL ,
DEVICE_TYPE VARCHAR(300) NOT NULL ,
POLICY_ID INTEGER NOT NULL ,
PRIMARY KEY (ID) ,
CONSTRAINT FK_DEVICE_TYPE_POLICY
@ -160,8 +160,8 @@ CREATE TABLE IF NOT EXISTS DM_DEVICE_TYPE_POLICY (
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT FK_DEVICE_TYPE_POLICY_DEVICE_TYPE
FOREIGN KEY (DEVICE_TYPE_ID )
REFERENCES DM_DEVICE_TYPE (ID )
FOREIGN KEY (DEVICE_TYPE )
REFERENCES DM_DEVICE_TYPE (NAME )
ON DELETE NO ACTION
ON UPDATE NO ACTION
);
@ -170,7 +170,7 @@ CREATE TABLE IF NOT EXISTS DM_PROFILE_FEATURES (
ID BIGSERIAL NOT NULL PRIMARY KEY,
PROFILE_ID INTEGER NOT NULL,
FEATURE_CODE VARCHAR(100) NOT NULL,
DEVICE_TYPE_ID INT NOT NULL,
DEVICE_TYPE VARCHAR(300) NOT NULL ,
TENANT_ID INTEGER NOT NULL ,
CONTENT BYTEA NULL DEFAULT NULL,
CONSTRAINT FK_DM_PROFILE_DM_POLICY_FEATURES
@ -272,7 +272,7 @@ CREATE TABLE IF NOT EXISTS DM_POLICY_COMPLIANCE_STATUS (
CREATE TABLE IF NOT EXISTS DM_POLICY_CHANGE_MGT (
ID BIGSERIAL NOT NULL PRIMARY KEY,
POLICY_ID INTEGER NOT NULL,
DEVICE_TYPE_ID INTEGER NOT NULL,
DEVICE_TYPE VARCHAR(300) NOT NULL,
TENANT_ID INTEGER NOT NULL
);

Loading…
Cancel
Save