|
|
@ -47,13 +47,14 @@ CREATE TABLE IF NOT EXISTS DM_DEVICE (
|
|
|
|
)ENGINE = InnoDB;
|
|
|
|
)ENGINE = InnoDB;
|
|
|
|
|
|
|
|
|
|
|
|
CREATE INDEX IDX_DM_DEVICE ON DM_DEVICE(TENANT_ID, DEVICE_TYPE_ID);
|
|
|
|
CREATE INDEX IDX_DM_DEVICE ON DM_DEVICE(TENANT_ID, DEVICE_TYPE_ID);
|
|
|
|
|
|
|
|
CREATE INDEX IDX_DM_DEVICE_TYPE_ID_DEVICE_IDENTIFICATION ON DM_DEVICE(TENANT_ID, DEVICE_TYPE_ID,DEVICE_IDENTIFICATION);
|
|
|
|
|
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS DM_DEVICE_PROPERTIES (
|
|
|
|
CREATE TABLE IF NOT EXISTS DM_DEVICE_PROPERTIES (
|
|
|
|
DEVICE_TYPE_NAME VARCHAR(300) NOT NULL,
|
|
|
|
DEVICE_TYPE_NAME VARCHAR(300) NOT NULL,
|
|
|
|
DEVICE_IDENTIFICATION VARCHAR(300) NOT NULL,
|
|
|
|
DEVICE_IDENTIFICATION VARCHAR(300) NOT NULL,
|
|
|
|
PROPERTY_NAME VARCHAR(100) DEFAULT 0,
|
|
|
|
PROPERTY_NAME VARCHAR(100) DEFAULT 0,
|
|
|
|
PROPERTY_VALUE VARCHAR(100) DEFAULT NULL,
|
|
|
|
PROPERTY_VALUE VARCHAR(100) DEFAULT NULL,
|
|
|
|
TENANT_ID VARCHAR(100) DEFAULT NULL,
|
|
|
|
TENANT_ID VARCHAR(100),
|
|
|
|
PRIMARY KEY (DEVICE_TYPE_NAME, DEVICE_IDENTIFICATION, PROPERTY_NAME, TENANT_ID)
|
|
|
|
PRIMARY KEY (DEVICE_TYPE_NAME, DEVICE_IDENTIFICATION, PROPERTY_NAME, TENANT_ID)
|
|
|
|
)ENGINE = InnoDB;
|
|
|
|
)ENGINE = InnoDB;
|
|
|
|
|
|
|
|
|
|
|
@ -134,6 +135,7 @@ CREATE TABLE IF NOT EXISTS DM_ENROLMENT (
|
|
|
|
|
|
|
|
|
|
|
|
CREATE INDEX IDX_ENROLMENT_FK_DEVICE_ID ON DM_ENROLMENT(DEVICE_ID);
|
|
|
|
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 INDEX IDX_ENROLMENT_DEVICE_ID_TENANT_ID ON DM_ENROLMENT(DEVICE_ID, TENANT_ID);
|
|
|
|
|
|
|
|
CREATE INDEX IDX_ENROLMENT_DEVICE_ID_TENANT_ID_STATUS ON DM_ENROLMENT(DEVICE_ID, TENANT_ID, STATUS);
|
|
|
|
|
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS DM_ENROLMENT_OP_MAPPING (
|
|
|
|
CREATE TABLE IF NOT EXISTS DM_ENROLMENT_OP_MAPPING (
|
|
|
|
ID INTEGER AUTO_INCREMENT NOT NULL,
|
|
|
|
ID INTEGER AUTO_INCREMENT NOT NULL,
|
|
|
@ -156,6 +158,7 @@ CREATE TABLE IF NOT EXISTS DM_ENROLMENT_OP_MAPPING (
|
|
|
|
CREATE INDEX IDX_ENROLMENT_OP_MAPPING ON DM_ENROLMENT_OP_MAPPING (UPDATED_TIMESTAMP);
|
|
|
|
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_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 INDEX IDX_EN_OP_MAPPING_OP_ID ON DM_ENROLMENT_OP_MAPPING(OPERATION_ID);
|
|
|
|
|
|
|
|
CREATE INDEX IDX_EN_OP_MAPPING_EN_ID_STATUS ON DM_ENROLMENT_OP_MAPPING(ENROLMENT_ID, STATUS);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS DM_DEVICE_OPERATION_RESPONSE (
|
|
|
|
CREATE TABLE IF NOT EXISTS DM_DEVICE_OPERATION_RESPONSE (
|
|
|
@ -583,4 +586,4 @@ DM_DEVICE.DEVICE_TYPE_ID = DM_DEVICE_TYPE.ID AND
|
|
|
|
DM_DEVICE.ID = DM_DEVICE_DETAIL.DEVICE_ID
|
|
|
|
DM_DEVICE.ID = DM_DEVICE_DETAIL.DEVICE_ID
|
|
|
|
ORDER BY TENANT_ID, DEVICE_ID;
|
|
|
|
ORDER BY TENANT_ID, DEVICE_ID;
|
|
|
|
|
|
|
|
|
|
|
|
-- END OF DASHBOARD RELATED VIEWS --
|
|
|
|
-- END OF DASHBOARD RELATED VIEWS --
|
|
|
|