diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/oracle.sql b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/oracle.sql index ef4d6de4006..728233d24b3 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/oracle.sql +++ b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/oracle.sql @@ -23,11 +23,11 @@ CREATE TABLE DM_DEVICE_CERTIFICATE ( SERIAL_NUMBER VARCHAR2(500) DEFAULT NULL, CERTIFICATE BLOB DEFAULT NULL, PRIMARY KEY (ID) -); - +) +/ -- Generate ID using sequence and trigger -CREATE SEQUENCE DM_DEVICE_CERTIFICATE_seq START WITH 1 INCREMENT BY 1; - +CREATE SEQUENCE DM_DEVICE_CERTIFICATE_seq START WITH 1 INCREMENT BY 1 NOCACHE +/ CREATE OR REPLACE TRIGGER DM_DEVICE_CERTIFICATE_seq_tr BEFORE INSERT ON DM_DEVICE_CERTIFICATE FOR EACH ROW WHEN (NEW.ID IS NULL)