diff --git a/components/subtype-mgt/io.entgra.device.mgt.subtype.mgt/src/main/java/io/entgra/device/mgt/subtype/mgt/dao/util/DAOUtil.java b/components/subtype-mgt/io.entgra.device.mgt.subtype.mgt/src/main/java/io/entgra/device/mgt/subtype/mgt/dao/util/DAOUtil.java index 0ab3f8e45c..61c1305923 100644 --- a/components/subtype-mgt/io.entgra.device.mgt.subtype.mgt/src/main/java/io/entgra/device/mgt/subtype/mgt/dao/util/DAOUtil.java +++ b/components/subtype-mgt/io.entgra.device.mgt.subtype.mgt/src/main/java/io/entgra/device/mgt/subtype/mgt/dao/util/DAOUtil.java @@ -19,8 +19,6 @@ package io.entgra.device.mgt.subtype.mgt.dao.util; import io.entgra.device.mgt.subtype.mgt.dto.DeviceSubType; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import java.sql.ResultSet; import java.sql.SQLException; @@ -29,8 +27,6 @@ import java.util.List; public class DAOUtil { - private static final Log log = LogFactory.getLog(DAOUtil.class); - public static DeviceSubType loadDeviceSubType(ResultSet rs) throws SQLException { DeviceSubType deviceSubType = new DeviceSubType() { @Override diff --git a/components/subtype-mgt/io.entgra.device.mgt.subtype.mgt/src/test/resources/carbon-home/dbscripts/dm-db-h2.sql b/components/subtype-mgt/io.entgra.device.mgt.subtype.mgt/src/test/resources/carbon-home/dbscripts/dm-db-h2.sql index 52b28e950d..2f5ae6c677 100644 --- a/components/subtype-mgt/io.entgra.device.mgt.subtype.mgt/src/test/resources/carbon-home/dbscripts/dm-db-h2.sql +++ b/components/subtype-mgt/io.entgra.device.mgt.subtype.mgt/src/test/resources/carbon-home/dbscripts/dm-db-h2.sql @@ -725,6 +725,57 @@ CREATE TABLE IF NOT EXISTS DM_GEOFENCE_EVENT_MAPPING ( -- END OF DM_GEOFENCE_GROUP_MAPPING TABLE-- +-- DM_EXT_GROUP_MAPPING TABLE-- +CREATE TABLE IF NOT EXISTS DM_EXT_GROUP_MAPPING ( + ID INT NOT NULL AUTO_INCREMENT, + TRACCAR_GROUP_ID INT DEFAULT 0, + GROUP_ID INT NOT NULL, + TENANT_ID INT NOT NULL, + STATUS INT DEFAULT 0, + PRIMARY KEY (ID) +); +-- END OF DM_EXT_GROUP_MAPPING TABLE-- + +-- END OF DM_EXT_DEVICE_MAPPING TABLE-- +CREATE TABLE IF NOT EXISTS DM_EXT_DEVICE_MAPPING ( + ID INT NOT NULL AUTO_INCREMENT, + TRACCAR_DEVICE_ID INT DEFAULT 0, + DEVICE_ID INT NOT NULL, + TENANT_ID INT NOT NULL, + STATUS INT DEFAULT 0, + PRIMARY KEY (ID) +); +-- END OF DM_EXT_DEVICE_MAPPING TABLE-- + +-- END OF DM_EXT_PERMISSION_MAPPING TABLE-- +CREATE TABLE IF NOT EXISTS DM_EXT_PERMISSION_MAPPING ( + TRACCAR_DEVICE_ID INT DEFAULT 0, + TRACCAR_USER_ID INT DEFAULT 0 +); +-- END OF DM_EXT_PERMISSION_MAPPING TABLE-- + +-- DYNAMIC TASK TABLES-- +CREATE TABLE IF NOT EXISTS DYNAMIC_TASK ( + DYNAMIC_TASK_ID INTEGER AUTO_INCREMENT NOT NULL, + NAME VARCHAR(300) DEFAULT NULL , + CRON VARCHAR(8000) DEFAULT NULL, + IS_ENABLED BOOLEAN NOT NULL DEFAULT FALSE, + TASK_CLASS_NAME VARCHAR(8000) DEFAULT NULL, + TENANT_ID INTEGER DEFAULT 0, + PRIMARY KEY (DYNAMIC_TASK_ID) +); + +CREATE TABLE IF NOT EXISTS DYNAMIC_TASK_PROPERTIES ( + DYNAMIC_TASK_ID INTEGER NOT NULL, + PROPERTY_NAME VARCHAR(100) DEFAULT 0, + PROPERTY_VALUE VARCHAR(100) DEFAULT NULL, + TENANT_ID VARCHAR(100), + PRIMARY KEY (DYNAMIC_TASK_ID, PROPERTY_NAME, TENANT_ID), + CONSTRAINT FK_DYNAMIC_TASK_TASK_PROPERTIES FOREIGN KEY (DYNAMIC_TASK_ID) REFERENCES + DYNAMIC_TASK (DYNAMIC_TASK_ID) ON DELETE CASCADE ON UPDATE CASCADE +); +-- END OF DYNAMIC TASK TABLE-- + -- DM_DEVICE_SUB_TYPE TABLE-- CREATE TABLE IF NOT EXISTS DM_DEVICE_SUB_TYPE ( TENANT_ID INT DEFAULT 0, diff --git a/components/subtype-mgt/io.entgra.device.mgt.subtype.mgt/src/test/resources/carbon-home/dbscripts/h2.sql b/components/subtype-mgt/io.entgra.device.mgt.subtype.mgt/src/test/resources/carbon-home/dbscripts/h2.sql index 0d00a78a22..0ed4a1d638 100644 --- a/components/subtype-mgt/io.entgra.device.mgt.subtype.mgt/src/test/resources/carbon-home/dbscripts/h2.sql +++ b/components/subtype-mgt/io.entgra.device.mgt.subtype.mgt/src/test/resources/carbon-home/dbscripts/h2.sql @@ -1,326 +1,3 @@ --- ----------------------------------------------------- --- Table `POWER_METER_DEVICE` --- ----------------------------------------------------- - -CREATE TABLE IF NOT EXISTS `POWER_METER_DEVICE` ( - `ID` INTEGER AUTO_INCREMENT NOT NULL, - `SERIAL` VARCHAR(45) NOT NULL, - `IP_ADDRESS` VARCHAR(45) NULL DEFAULT NULL, - `SIM_NUMBER` VARCHAR(45) NULL DEFAULT NULL, - `SUB_TYPE_ID` INT NOT NULL, - `CUSTOMER_REF` VARCHAR(45) NULL DEFAULT NULL, - `NODE_TYPE` VARCHAR(45) NULL DEFAULT NULL, - `CATEGORY` VARCHAR(45) NULL DEFAULT NULL, - `BRANCH` VARCHAR(45) NULL DEFAULT NULL, - `DEPOT` VARCHAR(45) NULL DEFAULT NULL, - `SUBSTATION_ID` VARCHAR(45) NULL DEFAULT NULL, - `HAS_EXPORT` VARCHAR(5) NULL DEFAULT NULL, - `COM_MODULE_IMEI` VARCHAR(45) NULL DEFAULT NULL, - `HAS_E_BILLING` VARCHAR(5) NULL DEFAULT NULL, - `IS_FEEDER_END` VARCHAR(5) NULL DEFAULT NULL, - `POLE_ID` VARCHAR(45) NULL DEFAULT NULL, - `METER_FW_VER` VARCHAR(45) NULL DEFAULT NULL, - `ASSIGNED_ON` TIMESTAMP NULL DEFAULT NULL, - PRIMARY KEY (`ID`, `SERIAL`)); - --- ----------------------------------------------------- --- Table `COMMUNICATION_MODULE` --- ----------------------------------------------------- - -CREATE TABLE IF NOT EXISTS `COMMUNICATION_MODULE` ( - `IMEI` VARCHAR(45) NOT NULL, - `SIM_IMSI` VARCHAR(45) NULL DEFAULT NULL, - `FW_VERSION` INT NULL DEFAULT 0, - `SUB_TYPE_ID` INT NOT NULL, - `SMS_PIN` VARCHAR(45) NULL DEFAULT NULL, - `BRANCH` VARCHAR(45) NULL DEFAULT NULL, - PRIMARY KEY (`IMEI`)); - --- ----------------------------------------------------- --- Table `METER_AUTHENTICATION_INFO` --- ----------------------------------------------------- - -CREATE TABLE IF NOT EXISTS `METER_AUTHENTICATION_INFO` ( - `ID` INT NOT NULL AUTO_INCREMENT, - `CLIENT_ADDRESS` INT NOT NULL, - `AUTHENTICATION` VARCHAR(100) NOT NULL, - `USER_ID` INT NOT NULL, - `PASSWORD` VARCHAR(100) NOT NULL, - `METER_SERIAL_ID` VARCHAR(45) NOT NULL, - PRIMARY KEY (`ID`)); - -CREATE INDEX IDX_METER_AUTHENTICATION_INFO -ON METER_AUTHENTICATION_INFO(CLIENT_ADDRESS, METER_SERIAL_ID); - --- ----------------------------------------------------- --- Table `METER_READINGS` --- ----------------------------------------------------- -CREATE TABLE IF NOT EXISTS `METER_READINGS` ( - `ID` INT NOT NULL AUTO_INCREMENT, - `OPERATION_ID` INT NOT NULL, - `OPERATION_CODE` VARCHAR(45) NOT NULL, - `SUB_TYPE_ID` INT NOT NULL, - `NODE_TYPE` VARCHAR(45) NULL DEFAULT NULL, - `CATEGORY` VARCHAR(45) NULL DEFAULT NULL, - `HAS_EXPORT` BOOLEAN NULL DEFAULT NULL, - `HAS_E_BILLING` BOOLEAN NULL DEFAULT NULL, - `BRANCH` VARCHAR(45) NULL DEFAULT NULL, - `DEPOT` VARCHAR(45) NULL DEFAULT NULL, - `SUBSTATION_ID` VARCHAR(45) NULL DEFAULT NULL, - `SERIAL` VARCHAR(45) NOT NULL, - `CUSTOMER_REF` VARCHAR(45) NULL DEFAULT NULL, - `RESPONSE` BLOB NOT NULL, - `TIMESTAMP` BIGINT(15) NOT NULL, - `IS_PARTIAL_RESULT` BOOLEAN NOT NULL DEFAULT FALSE, - PRIMARY KEY (`ID`)); - --- --- Table structure for table `LAST_METER_READING` --- -CREATE TABLE IF NOT EXISTS LAST_METER_READING ( - SERIAL VARCHAR(45) NOT NULL, - OPERATION_ID INTEGER NOT NULL, - SUB_TYPE_ID INT NOT NULL DEFAULT 0, - NODE_TYPE VARCHAR(45) NULL DEFAULT NULL, - CATEGORY VARCHAR(45) NULL DEFAULT NULL, - HAS_EXPORT BOOLEAN NULL DEFAULT NULL, - HAS_E_BILLING BOOLEAN NULL DEFAULT NULL, - BRANCH VARCHAR(45) NULL DEFAULT NULL, - DEPOT VARCHAR(45) NULL DEFAULT NULL, - SUBSTATION_ID VARCHAR(45) NULL DEFAULT NULL, - CUSTOMER_REF VARCHAR(45) NULL DEFAULT NULL, - RESPONSE LONGBLOB NOT NULL, - LAST_READING_TIMESTAMP BIGINT NOT NULL, - PRIMARY KEY (SERIAL) -); - --- ----------------------------------------------------- --- Table `PROFILE_READINGS` --- ----------------------------------------------------- -CREATE TABLE IF NOT EXISTS `PROFILE_READINGS` ( - `ID` INT NOT NULL AUTO_INCREMENT, - `OPERATION_ID` INT NOT NULL, - `OBIS` VARCHAR(45) NULL DEFAULT NULL, - `SUB_TYPE_ID` INT NOT NULL, - `NODE_TYPE` VARCHAR(45) NULL DEFAULT NULL, - `CATEGORY` VARCHAR(45) NULL DEFAULT NULL, - `HAS_EXPORT` BOOLEAN NULL DEFAULT NULL, - `HAS_E_BILLING` BOOLEAN NULL DEFAULT NULL, - `BRANCH` VARCHAR(45) NULL DEFAULT NULL, - `DEPOT` VARCHAR(45) NULL DEFAULT NULL, - `SUBSTATION_ID` VARCHAR(45) NULL DEFAULT NULL, - `SERIAL` VARCHAR(45) NOT NULL, - `CUSTOMER_REF` VARCHAR(45) NULL DEFAULT NULL, - `PROFILE_DATA` BLOB NOT NULL, - `TIMESTAMP` BIGINT(15) NOT NULL, - PRIMARY KEY (`ID`)); - --- ----------------------------------------------------- --- Table `METER_INSTALL` --- ----------------------------------------------------- -CREATE TABLE IF NOT EXISTS `METER_INSTALL` ( - `ID` INT NOT NULL AUTO_INCREMENT, - `SERIAL` VARCHAR(45) NOT NULL, - `USERNAME` VARCHAR(45) NULL DEFAULT NULL, - `JOB_ID` VARCHAR(45) NULL DEFAULT NULL, - `LAB_SEAL` VARCHAR(45) NULL DEFAULT NULL, - `COM_MODULE_SEAL` VARCHAR(45) NULL DEFAULT NULL, - `TERMINAL_COVER_SEAL` VARCHAR(45) NULL DEFAULT NULL, - `METER_ENCLOSURE_SEAL` VARCHAR(45) NULL DEFAULT NULL, - `PRINTED_SERIAL` VARCHAR(45) NULL DEFAULT NULL, - `CUSTOMER_REF` VARCHAR(45) NULL DEFAULT NULL, - `IMPORT_READING` DOUBLE DEFAULT 0, - `EXPORT_READING` DOUBLE DEFAULT 0, - `READING_TIMESTAMP` BIGINT(15) DEFAULT 0, - `TIMESTAMP` TIMESTAMP NOT NULL, - PRIMARY KEY (`ID`)); - --- ----------------------------------------------------- --- Table `METER_UNINSTALL` --- ----------------------------------------------------- -CREATE TABLE IF NOT EXISTS `METER_UNINSTALL` ( - `ID` INT NOT NULL AUTO_INCREMENT, - `SERIAL` VARCHAR(45) NOT NULL, - `USERNAME` VARCHAR(45) NULL DEFAULT NULL, - `JOB_ID` VARCHAR(45) NULL DEFAULT NULL, - `LAB_SEAL` VARCHAR(45) NULL DEFAULT NULL, - `COM_MODULE_SEAL` VARCHAR(45) NULL DEFAULT NULL, - `TERMINAL_COVER_SEAL` VARCHAR(45) NULL DEFAULT NULL, - `METER_ENCLOSURE_SEAL` VARCHAR(45) NULL DEFAULT NULL, - `PRINTED_SERIAL` VARCHAR(45) NULL DEFAULT NULL, - `CUSTOMER_REF` VARCHAR(45) NULL DEFAULT NULL, - `IMPORT_READING` DOUBLE DEFAULT 0, - `EXPORT_READING` DOUBLE DEFAULT 0, - `READING_TIMESTAMP` BIGINT(15) DEFAULT 0, - `TIMESTAMP` TIMESTAMP NOT NULL, - PRIMARY KEY (`ID`)); - --- ----------------------------------------------------- --- Table `RSSI_LEVEL` --- ----------------------------------------------------- -CREATE TABLE IF NOT EXISTS `RSSI_LEVEL` ( - `ID` INT NOT NULL AUTO_INCREMENT, - `IMEI` VARCHAR(45) NOT NULL, - `SIM_IMSI` VARCHAR(45) NULL DEFAULT NULL, - `FW_VERSION` INT NULL DEFAULT 0, - `COM_TYPE_ID` INT NOT NULL, - `RSSI` INT NULL DEFAULT 0, - `NETWORK` VARCHAR(45) NULL DEFAULT NULL, - `CELL_ID` VARCHAR(45) NULL DEFAULT NULL, - `LAC` VARCHAR(45) NULL DEFAULT NULL, - `RSRP` DECIMAL (5, 2) NULL DEFAULT 0, - `RSRQ` DECIMAL (5, 2) NULL DEFAULT 0, - `SNR` DECIMAL (5, 2) NULL DEFAULT 0, - `PCI` INT NULL DEFAULT 0, - `TRANSPORT` VARCHAR(45) NULL DEFAULT NULL, - `TIMESTAMP` BIGINT(15) NOT NULL, - PRIMARY KEY (`ID`)); - --- ----------------------------------------------------- --- Table `REQUEST` --- ----------------------------------------------------- - -CREATE TABLE IF NOT EXISTS `REQUEST` ( - `ID` int NOT NULL AUTO_INCREMENT, - `DUE_DATE` bigint DEFAULT '0', - `REQUESTED_BY` varchar(100) NOT NULL, - `REQUESTED_DATE` bigint DEFAULT '0', - `STATUS` varchar(45) NOT NULL, - `BRANCH` varchar(45) DEFAULT NULL, - `REMARKS` varchar(255) NOT NULL, - `REQUEST_TYPE` int NOT NULL, - PRIMARY KEY (`ID`) -) ; - --- ----------------------------------------------------- --- Table `METER_ASSIGNMENT_REQUEST` --- ----------------------------------------------------- - -CREATE TABLE IF NOT EXISTS `METER_ASSIGNMENT_REQUEST` ( - `ID` int NOT NULL, - `SUB_TYPE_ID` int NOT NULL, - `PRIMARY_CT_RATIO` float DEFAULT '0', - `SECONDARY_CT_RATIO` float DEFAULT '0', - `PRIMARY_PT_RATIO` float DEFAULT '0', - `SECONDARY_PT_RATIO` float DEFAULT '0', - `NODE_TYPE` varchar(45) DEFAULT NULL, - `REQUESTED_COUNT` int NOT NULL, - `ACCEPTED_COUNT` int DEFAULT NULL, - `ASSIGNED_COUNT` int DEFAULT NULL, - `SUBSTATION_ID` varchar(45) DEFAULT NULL, - `CUSTOMER_REF` varchar(45) DEFAULT NULL, - `DEPOT` VARCHAR(45) DEFAULT NULL, - `PURPOSE` VARCHAR(50) DEFAULT NULL, - `ADDRESS` VARCHAR(255) DEFAULT NULL, - `DESCRIPTION` VARCHAR(100) DEFAULT NULL, - PRIMARY KEY (`ID`), - CONSTRAINT `fk_ASSIGNMENT_REQUEST_REQUEST` FOREIGN KEY (`ID`) REFERENCES `REQUEST` (`ID`) -) ; - --- ----------------------------------------------------- --- Table `DISCONNECTION_REQUEST` --- ------------------------------------------------------- -CREATE TABLE IF NOT EXISTS `DISCONNECTION_REQUEST` ( - `ID` int NOT NULL, - `ACTIVITY_ID` VARCHAR(45) DEFAULT NULL, - PRIMARY KEY (`ID`), - CONSTRAINT `fk_DISCONNECTION_REQUEST_REQUEST` FOREIGN KEY (`ID`) REFERENCES `REQUEST` (`ID`) -) ; - --- ----------------------------------------------------- --- Table `FIELD_TEST_REQUEST` --- ------------------------------------------------------- -CREATE TABLE IF NOT EXISTS `FIELD_TEST_REQUEST` ( - `ID` int NOT NULL, - `TEAM` varchar(255) DEFAULT NULL, - `SCHEDULED_DATE` bigint DEFAULT '0', - `RESULT` varchar(50) DEFAULT NULL, - `ATTACHMENT` blob, - PRIMARY KEY (`ID`), - CONSTRAINT `fk_ASSIGNMENT_FIELD_TEST_REQUEST_REQUEST` FOREIGN KEY (`ID`) REFERENCES `REQUEST` (`ID`) -); - --- ----------------------------------------------------- --- Table `LOAD_PROFILE_REQUEST` --- ------------------------------------------------------- -CREATE TABLE IF NOT EXISTS `LOAD_PROFILE_REQUEST` ( - `ID` int NOT NULL, - `ACTIVITY_ID` VARCHAR(45) DEFAULT NULL, - `START_DATE` bigint DEFAULT '0', - `END_DATE` bigint DEFAULT '0', - PRIMARY KEY (`ID`), - CONSTRAINT `fk_LOAD_PROFILE_REQUEST_REQUEST_REQUEST` FOREIGN KEY (`ID`) REFERENCES `REQUEST` (`ID`) -); - --- ----------------------------------------------------- --- Table `READOUT_REQUEST` --- ------------------------------------------------------- - -CREATE TABLE `READOUT_REQUEST` ( - `ID` int NOT NULL, - `ACTIVITY_ID` VARCHAR(45) DEFAULT NULL, - PRIMARY KEY (`ID`), - CONSTRAINT `fk_READUOT_REQUEST_REQUEST_REQUEST` FOREIGN KEY (`ID`) REFERENCES `REQUEST` (`ID`) -); - --- ----------------------------------------------------- --- Table `COM_MODULE_REQUEST` --- ----------------------------------------------------- - -CREATE TABLE IF NOT EXISTS `COM_MODULE_REQUEST` ( - `ID` INT NOT NULL, - `MODULE_TYPE` VARCHAR(45) NOT NULL, - `REQUESTED_COUNT` INT NOT NULL, - `ACCEPTED_COUNT` INT DEFAULT NULL, - `ASSIGNED_COUNT` INT DEFAULT NULL, - PRIMARY KEY (`ID`), - CONSTRAINT `fk_COM_MODULE_REQUEST_REQUEST` FOREIGN KEY (`ID`) - REFERENCES `REQUEST` (`ID`) -); - --- ----------------------------------------------------- --- Table `RECONNECTION_REQUEST` --- ----------------------------------------------------- -CREATE TABLE IF NOT EXISTS `RECONNECTION_REQUEST` ( - `ID` int NOT NULL, - `ACTIVITY_ID` VARCHAR(45) DEFAULT NULL, - PRIMARY KEY (`ID`), - CONSTRAINT `fk_RECONNECTION_REQUEST_REQUEST` FOREIGN KEY (`ID`) - REFERENCES `REQUEST` (`ID`) ON DELETE NO ACTION ON UPDATE NO ACTION -); - - ------------------------------------------------------ --- Table `REQUEST_LIFECYCLE_EVENT` --- ----------------------------------------------------- - -CREATE TABLE IF NOT EXISTS `REQUEST_LIFECYCLE_EVENT` ( - `ID` int NOT NULL AUTO_INCREMENT, - `REQUEST_ID` int NOT NULL, - `UPDATED_BY` varchar(100) NOT NULL, - `UPDATED_DATE` bigint DEFAULT '0', - `STATUS` varchar(45) NOT NULL, - `REMARKS` varchar(200) DEFAULT NULL, - PRIMARY KEY (`ID`), - CONSTRAINT `fk_REQUEST_LIFECYCLE_EVENT_REQUEST` FOREIGN KEY (`REQUEST_ID`) REFERENCES `REQUEST` (`ID`) -) ; - - --- ----------------------------------------------------- --- Table `DEVICE_EVENTS` --- ----------------------------------------------------- -CREATE TABLE IF NOT EXISTS `PROCESSED_DEVICE_EVENTS` ( - `ID` INT NOT NULL AUTO_INCREMENT, - `METER_SERIAL` VARCHAR(45), - `IP_ADDRESS` VARCHAR(45), - `NUMBER` VARCHAR(45), - `TYPE` VARCHAR(45) NOT NULL, - `KEY` VARCHAR(100) NOT NULL, - `VALUE` VARCHAR(100) NOT NULL, - `EVENT` VARCHAR(45) NOT NULL, - `TIMESTAMP` BIGINT(15) DEFAULT 0, - PRIMARY KEY (`ID`)); - -- ----------------------------------------------------- -- Table `DM_DEVICE_SUB_TYPE` -- ----------------------------------------------------- @@ -334,32 +11,6 @@ CREATE TABLE IF NOT EXISTS `PROCESSED_DEVICE_EVENTS` ( PRIMARY KEY (`SUB_TYPE_ID`,`DEVICE_TYPE`) ); - -- ----------------------------------------------------- --- Table `OPERATION_TEMPLATE` --- ----------------------------------------------------- - -CREATE TABLE IF NOT EXISTS `OPERATION_TEMPLATE`( - `TEMPLATE_ID` INT NOT NULL AUTO_INCREMENT, - `SUB_TYPE_ID` INT NOT NULL, - `OPERATION_CODE` VARCHAR(100) NOT NULL, - `OPERATION_DEFINITION` TEXT DEFAULT NULL, - PRIMARY KEY (`TEMPLATE_ID`) -); - --- ----------------------------------------------------- --- Table `GENERIC_METER_REGISTER` --- ----------------------------------------------------- - -CREATE TABLE IF NOT EXISTS `GENERIC_METER_REGISTER`( - `RRPK_ID` VARCHAR(100) NOT NULL, - `DESCRIPTION` VARCHAR(100) NOT NULL, - `UNIT` VARCHAR(45) NULL DEFAULT NULL, - `ORDER` INT NOT NULL, - PRIMARY KEY (`RRPK_ID`) -); - - - -- ----------------------------------------------------- -- Sample data for DAO test cases -- ----------------------------------------------------- @@ -375,39 +26,6 @@ INSERT INTO DM_ENROLMENT(DEVICE_ID,OWNER,OWNERSHIP,STATUS,IS_TRANSFERRED,DATE_OF (1,'admin','COPE','ACTIVE',0,'2022-04-11 15:41:30','2022-04-11 15:41:30',-1234), (2,'admin','COPE','ACTIVE',0,'2022-04-11 15:41:30','2022-04-11 15:41:30',-1234), (3,'admin','COPE','ACTIVE',0,'2022-04-11 15:41:30','2022-04-11 15:41:30',-1234); -INSERT INTO DM_DEVICE_PROPERTIES (DEVICE_TYPE_NAME,DEVICE_IDENTIFICATION,PROPERTY_NAME,PROPERTY_VALUE,TENANT_ID) VALUES -('sim','413012689159555','APN','LECOSMSTC',-1234), -('sim','413012689159555','IP_ADDRESS','192.168.118.111',-1234), -('sim','413012689159555','MOBILE_NO','+94713192111',-1234), -('sim','413012689159555','SUB_TYPE_ID','1',-1234), -('sim','413012689159555','token',NULL,-1234), -('communication-module','864495036647555','BRANCH','KOTTE',-1234), -('communication-module','864495036647555','FW_VERSION','6',-1234), -('communication-module','864495036647555','SIM_IMSI','413012689159555',-1234), -('communication-module','864495036647555','SIM_PIN','1234',-1234), -('communication-module','864495036647555','SUB_TYPE_ID','1',-1234), -('communication-module','864495036647555','token',NULL,-1234), -('power-meter','000019729555','BRANCH','KOTTE',-1234), -('power-meter','000019729555','CATEGORY','BILLING_BULK',-1234), -('power-meter','000019729555','COM_MODULE_IMEI','864495036647555',-1234), -('power-meter','000019729555','CUSTOMER_REF','0602297555',-1234), -('power-meter','000019729555','DEPOT','PITA-KOTTE',-1234), -('power-meter','000019729555','HAS_EXPORT','false',-1234), -('power-meter','000019729555','HAS_E_BILLING','false',-1234), -('power-meter','000019729555','IP_ADDRESS','192.168.118.111',-1234), -('power-meter','000019729555','IS_FEEDER_END','false',-1234), -('power-meter','000019729555','NODE_TYPE','BILLING',-1234), -('power-meter','000019729555','POLE_ID','NW55/5/15C',-1234), -('power-meter','000019729555','SIM_NUMBER','+94713192111',-1234), -('power-meter','000019729555','SUBSTATION_ID','AZ8555',-1234), -('power-meter','000019729555','SUB_TYPE_ID','1',-1234), -('power-meter','000019729555','token',NULL,-1234); - - --- INSERT INTO SIM_DEVICE (IMSI,IP_ADDRESS,MOBILE_NO,SUB_TYPE_ID,APN) VALUES ('413012689159555','10.217.55.155','+94713192111',1,'LECOSMSTC'); -INSERT INTO COMMUNICATION_MODULE(IMEI,SIM_IMSI,FW_VERSION,SUB_TYPE_ID,BRANCH,SMS_PIN) VALUES ('864495036647555','413012689159555',6,1,'KOTTE','1234'); -INSERT INTO POWER_METER_DEVICE (SERIAL,IP_ADDRESS,SIM_NUMBER,COM_MODULE_IMEI,SUB_TYPE_ID,CUSTOMER_REF,NODE_TYPE,CATEGORY,BRANCH,DEPOT,SUBSTATION_ID,HAS_EXPORT,HAS_E_BILLING,IS_FEEDER_END,POLE_ID,ASSIGNED_ON) -VALUES ('000019729555','192.168.118.111','+94713192111','864495036647555',1,'0602297555','BILLING','BILLING_BULK','KOTTE','PITA-KOTTE','AZ82555','false','false','false','NW55/5/15C',NULL); INSERT INTO DM_DEVICE_SUB_TYPE (SUB_TYPE_ID, TENANT_ID, DEVICE_TYPE, SUB_TYPE_NAME, TYPE_DEFINITION) VALUES (3,-1234,'Meter','TestSubType','{"make": "TestSubType", "model": "ATx-Mega SIM800", "subTypeId": 3, "hasSMSSupport": true, "hasICMPSupport": true, "socketServerPort": 8071}'),