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 0b1256d5ee4..8c98587ffea 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 @@ -7,16 +7,16 @@ CREATE TABLE DM_DEVICE_TYPE ( ) / -- Generate ID using sequence and trigger -CREATE SEQUENCE DM_DEVICE_TYPE_seq START WITH 1 INCREMENT BY 1 NOCACHE +CREATE SEQUENCE DM_DEVICE_TYPE_id_seq START WITH 1 INCREMENT BY 1 NOCACHE / -CREATE OR REPLACE TRIGGER DM_DEVICE_TYPE_seq_tr +CREATE OR REPLACE TRIGGER DM_DEVICE_TYPE_id_seq_tr BEFORE INSERT ON DM_DEVICE_TYPE REFERENCING NEW AS NEW FOR EACH ROW WHEN (NEW.ID IS NULL) BEGIN - SELECT DM_DEVICE_TYPE_seq.NEXTVAL INTO :NEW.ID FROM DUAL; + SELECT DM_DEVICE_TYPE_id_seq.NEXTVAL INTO :NEW.ID FROM DUAL; END; /