Update h2.sql with traccar group/device mapping tables

merge-requests/899/head
Rushdi Mohamed 3 years ago
parent c3dd560878
commit 9d9ff9f391

@ -748,3 +748,29 @@ CREATE TABLE IF NOT EXISTS DM_GEOFENCE_EVENT_MAPPING (
);
-- END OF DM_GEOFENCE_GROUP_MAPPING TABLE--
-- DM_TRACCAR_GROUP_MAPPING TABLE--
CREATE TABLE IF NOT EXISTS DM_TRACCAR_GROUP_MAPPING (
ID INT NOT NULL AUTO_INCREMENT,
TRACCAR_GROUP_ID INT NOT NULL,
GROUP_ID INT NOT NULL,
TENANT_ID INT NOT NULL,
PRIMARY KEY (ID),
CONSTRAINT fk_dm_group_traccar_group_mapping FOREIGN KEY (GROUP_ID) REFERENCES
DM_GROUP (ID) ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT uk_traccar_group UNIQUE (TRACCAR_GROUP_ID, GROUP_ID, TENANT_ID)
);
-- END OF DM_TRACCAR_GROUP_MAPPING TABLE--
-- END OF DM_TRACCAR_DEVICE_MAPPING TABLE--
CREATE TABLE IF NOT EXISTS DM_TRACCAR_DEVICE_MAPPING (
ID INT NOT NULL AUTO_INCREMENT,
TRACCAR_DEVICE_ID INT NOT NULL,
DEVICE_ID INT NOT NULL,
TENANT_ID INT NOT NULL,
PRIMARY KEY (ID),
CONSTRAINT fk_dm_device_traccar_device_mapping FOREIGN KEY (DEVICE_ID) REFERENCES
DM_DEVICE (ID) ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT uk_traccar_device UNIQUE (TRACCAR_DEVICE_ID, DEVICE_ID, TENANT_ID)
);
-- END OF DM_TRACCAR_DEVICE_MAPPING TABLE--

Loading…
Cancel
Save