diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/h2.sql b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/h2.sql index c714d38d3b..34b385655c 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/h2.sql +++ b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/h2.sql @@ -502,8 +502,8 @@ CREATE TABLE IF NOT EXISTS DM_DEVICE_GROUP_POLICY ( ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT FK_DM_DEVICE_GROUP_DM_POLICY - FOREIGN KEY (POLICY_ID , DEVICE_GROUP_ID) - REFERENCES DM_POLICY (ID , ID) + FOREIGN KEY (POLICY_ID) + REFERENCES DM_POLICY (ID) ON DELETE NO ACTION ON UPDATE NO ACTION ); diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/mssql.sql b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/mssql.sql index 6101c9e5a8..ffbeff63e0 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/mssql.sql +++ b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/mssql.sql @@ -353,8 +353,8 @@ CREATE TABLE DM_DEVICE_GROUP_POLICY ( ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT FK_DM_DEVICE_GROUP_DM_POLICY - FOREIGN KEY (POLICY_ID , DEVICE_GROUP_ID) - REFERENCES DM_POLICY (ID , ID) + FOREIGN KEY (POLICY_ID) + REFERENCES DM_POLICY (ID) ON DELETE NO ACTION ON UPDATE NO ACTION ); diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/mysql.sql b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/mysql.sql index 4fcbd14461..e031ea2fe2 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/mysql.sql +++ b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/mysql.sql @@ -423,8 +423,8 @@ CREATE TABLE IF NOT EXISTS DM_DEVICE_GROUP_POLICY ( ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT FK_DM_DEVICE_GROUP_DM_POLICY - FOREIGN KEY (POLICY_ID , DEVICE_GROUP_ID) - REFERENCES DM_POLICY (ID , ID) + FOREIGN KEY (POLICY_ID) + REFERENCES DM_POLICY (ID) ON DELETE NO ACTION ON UPDATE NO ACTION )ENGINE = InnoDB; 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 fa9ac2e783..ab74524c59 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 @@ -580,8 +580,8 @@ CREATE TABLE DM_DEVICE_GROUP_POLICY ( REFERENCES DM_GROUP (ID) , CONSTRAINT FK_DM_DEVICE_GROUP_DM_POLICY - FOREIGN KEY (POLICY_ID , DEVICE_GROUP_ID) - REFERENCES DM_POLICY (ID , ID) + FOREIGN KEY (POLICY_ID) + REFERENCES DM_POLICY (ID) ) ; -- Generate ID using sequence and trigger diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/postgresql.sql b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/postgresql.sql index 5fcf3f99ac..8a0feb456c 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/postgresql.sql +++ b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/postgresql.sql @@ -306,8 +306,8 @@ CREATE TABLE IF NOT EXISTS DM_DEVICE_GROUP_POLICY ( ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT FK_DM_DEVICE_GROUP_DM_POLICY - FOREIGN KEY (POLICY_ID , DEVICE_GROUP_ID) - REFERENCES DM_POLICY (ID , ID) + FOREIGN KEY (POLICY_ID) + REFERENCES DM_POLICY (ID) ON DELETE NO ACTION ON UPDATE NO ACTION );