|
|
|
@ -5,7 +5,8 @@ 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 INDEX IDX_DEVICE_TYPE ON DM_DEVICE_TYPE (NAME);
|
|
|
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS DM_DEVICE (
|
|
|
|
|
ID INTEGER AUTO_INCREMENT NOT NULL,
|
|
|
|
@ -20,13 +21,14 @@ CREATE TABLE IF NOT EXISTS DM_DEVICE (
|
|
|
|
|
REFERENCES DM_DEVICE_TYPE (ID) ON DELETE NO ACTION ON UPDATE NO ACTION
|
|
|
|
|
)ENGINE = InnoDB;
|
|
|
|
|
|
|
|
|
|
CREATE INDEX IDX_DM_DEVICE ON DM_DEVICE(TENANT_ID, DEVICE_TYPE_ID);
|
|
|
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS DM_OPERATION (
|
|
|
|
|
ID INTEGER AUTO_INCREMENT NOT NULL,
|
|
|
|
|
TYPE VARCHAR(50) NOT NULL,
|
|
|
|
|
TYPE VARCHAR(20) NOT NULL,
|
|
|
|
|
CREATED_TIMESTAMP TIMESTAMP NOT NULL,
|
|
|
|
|
RECEIVED_TIMESTAMP TIMESTAMP NULL,
|
|
|
|
|
OPERATION_CODE VARCHAR(1000) NOT NULL,
|
|
|
|
|
OPERATION_CODE VARCHAR(50) NOT NULL,
|
|
|
|
|
PRIMARY KEY (ID)
|
|
|
|
|
)ENGINE = InnoDB;
|
|
|
|
|
|
|
|
|
@ -83,6 +85,8 @@ CREATE TABLE IF NOT EXISTS DM_ENROLMENT (
|
|
|
|
|
DM_DEVICE (ID) ON DELETE NO ACTION ON UPDATE NO ACTION
|
|
|
|
|
)ENGINE = InnoDB;
|
|
|
|
|
|
|
|
|
|
CREATE INDEX IDX_ENROLMENT_FK_DEVICE_ID ON DM_ENROLMENT(DEVICE_ID);
|
|
|
|
|
CREATE INDEX IDX_ENROLMENT_DEVICE_ID_TENANT_ID ON DM_ENROLMENT(DEVICE_ID, TENANT_ID);
|
|
|
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS DM_ENROLMENT_OP_MAPPING (
|
|
|
|
|
ID INTEGER AUTO_INCREMENT NOT NULL,
|
|
|
|
@ -98,6 +102,9 @@ CREATE TABLE IF NOT EXISTS DM_ENROLMENT_OP_MAPPING (
|
|
|
|
|
DM_OPERATION (ID) ON DELETE NO ACTION ON UPDATE NO ACTION
|
|
|
|
|
)ENGINE = InnoDB;
|
|
|
|
|
|
|
|
|
|
CREATE INDEX IDX_ENROLMENT_OP_MAPPING ON DM_ENROLMENT_OP_MAPPING (UPDATED_TIMESTAMP);
|
|
|
|
|
CREATE INDEX IDX_EN_OP_MAPPING_EN_ID ON DM_ENROLMENT_OP_MAPPING(ENROLMENT_ID);
|
|
|
|
|
CREATE INDEX IDX_EN_OP_MAPPING_OP_ID ON DM_ENROLMENT_OP_MAPPING(OPERATION_ID);
|
|
|
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS DM_DEVICE_OPERATION_RESPONSE (
|
|
|
|
|
ID INTEGER AUTO_INCREMENT NOT NULL,
|
|
|
|
|