From a401c9d91d9ac543a1cd83ae147d429d52129d7d Mon Sep 17 00:00:00 2001 From: Pahansith Date: Tue, 10 Nov 2020 23:53:36 +0530 Subject: [PATCH] Fix test failure --- .../src/main/resources/dbscripts/cdm/h2.sql | 34 +++++++++++++------ 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/dbscripts/cdm/h2.sql b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/dbscripts/cdm/h2.sql index 17ebaa6451e..dcd89c36541 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/dbscripts/cdm/h2.sql +++ b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/dbscripts/cdm/h2.sql @@ -649,15 +649,15 @@ ORDER BY TENANT_ID, DEVICE_ID; -- END OF DASHBOARD RELATED VIEWS -- --- GEOFENCE RELATED DATA -- +-- DM_GEOFENCE TABLE-- CREATE TABLE IF NOT EXISTS DM_GEOFENCE ( ID INT NOT NULL AUTO_INCREMENT, - FENCE_NAME VARCHAR(100) NOT NULL, + FENCE_NAME VARCHAR(255) NOT NULL, DESCRIPTION TEXT DEFAULT NULL, - LATITUDE DOUBLE NULL, - LONGITUDE DOUBLE NULL, - RADIUS DOUBLE NULL, + LATITUDE DOUBLE DEFAULT NULL, + LONGITUDE DOUBLE DEFAULT NULL, + RADIUS DOUBLE DEFAULT NULL, GEO_JSON TEXT DEFAULT NULL, FENCE_SHAPE VARCHAR(100) DEFAULT NULL, CREATED_TIMESTAMP TIMESTAMP NOT NULL, @@ -666,7 +666,7 @@ CREATE TABLE IF NOT EXISTS DM_GEOFENCE ( PRIMARY KEY (ID) ); --- END OF GEOFENCE RELATED DATA -- +-- END OF DM_GEOFENCE TABLE-- -- DM_GEOFENCE_GROUP_MAPPING TABLE-- CREATE TABLE IF NOT EXISTS DM_GEOFENCE_GROUP_MAPPING ( @@ -678,7 +678,7 @@ CREATE TABLE IF NOT EXISTS DM_GEOFENCE_GROUP_MAPPING ( DM_GEOFENCE (ID) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT fk_dm_geofence_group_mapping_group FOREIGN KEY (GROUP_ID) REFERENCES DM_GROUP (ID) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB; +); -- END OF DM_GEOFENCE_GROUP_MAPPING TABLE-- @@ -692,7 +692,7 @@ CREATE TABLE IF NOT EXISTS DM_DEVICE_EVENT ( CREATED_TIMESTAMP TIMESTAMP NOT NULL, TENANT_ID INTEGER DEFAULT 0, PRIMARY KEY (ID) -) ENGINE=InnoDB; +); -- END OF DM_DEVICE_EVENT TABLE -- @@ -706,6 +706,20 @@ CREATE TABLE IF NOT EXISTS DM_DEVICE_EVENT_GROUP_MAPPING ( DM_DEVICE_EVENT (ID) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT fk_dm_event_group_mapping_group FOREIGN KEY (GROUP_ID) REFERENCES DM_GROUP (ID) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB; +); + +-- END OF DM_DEVICE_EVENT_GROUP_MAPPING TABLE-- + +-- DM_GEOFENCE_GROUP_MAPPING TABLE-- +CREATE TABLE IF NOT EXISTS DM_GEOFENCE_EVENT_MAPPING ( + ID INT NOT NULL AUTO_INCREMENT, + FENCE_ID INT NOT NULL, + EVENT_ID INT NOT NULL, + PRIMARY KEY (ID), + CONSTRAINT fk_dm_geofence_event_mapping_geofence FOREIGN KEY (FENCE_ID) REFERENCES + DM_GEOFENCE (ID) ON DELETE NO ACTION ON UPDATE NO ACTION, + CONSTRAINT fk_dm_geofence_event_mapping_event FOREIGN KEY (EVENT_ID) REFERENCES + DM_DEVICE_EVENT (ID) ON DELETE NO ACTION ON UPDATE NO ACTION +); --- END OF DM_DEVICE_EVENT_GROUP_MAPPING TABLE-- \ No newline at end of file +-- END OF DM_GEOFENCE_GROUP_MAPPING TABLE-- \ No newline at end of file