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 fc5639649fe..b2f954f69e9 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 @@ -311,12 +311,7 @@ CREATE TABLE DM_POLICY_COMPLIANCE_STATUS ( LAST_REQUESTED_TIME DATETIME2(0) NULL, LAST_FAILED_TIME DATETIME2(0) NULL, ATTEMPTS INT NULL, - PRIMARY KEY (ID), - CONSTRAINT FK_POLICY_COMPLIANCE_STATUS_POLICY - FOREIGN KEY (POLICY_ID) - REFERENCES DM_POLICY (ID) - ON DELETE NO ACTION - ON UPDATE NO ACTION + PRIMARY KEY (ID) ); 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 2132a66d0ed..2c0fa846246 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 @@ -302,12 +302,7 @@ CREATE TABLE IF NOT EXISTS DM_POLICY_COMPLIANCE_STATUS ( LAST_REQUESTED_TIME TIMESTAMP NULL, LAST_FAILED_TIME TIMESTAMP NULL, ATTEMPTS INT NULL, - PRIMARY KEY (ID), - CONSTRAINT FK_POLICY_COMPLIANCE_STATUS_POLICY - FOREIGN KEY (POLICY_ID) - REFERENCES DM_POLICY (ID) - ON DELETE NO ACTION - ON UPDATE NO ACTION + PRIMARY KEY (ID) )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 dd6fa2c6217..ffe05d4acdf 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 @@ -503,10 +503,7 @@ CREATE TABLE DM_POLICY_COMPLIANCE_STATUS ( LAST_REQUESTED_TIME TIMESTAMP(0) NULL, LAST_FAILED_TIME TIMESTAMP(0) NULL, ATTEMPTS NUMBER(10) NULL, - CONSTRAINT PK_DM_POLICY_COMP_STATUS PRIMARY KEY (ID), - CONSTRAINT FK_POLICY_COMP_STATUS_POLICY - FOREIGN KEY (POLICY_ID) - REFERENCES DM_POLICY (ID) + CONSTRAINT PK_DM_POLICY_COMP_STATUS PRIMARY KEY (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 f04cb691b7d..84ecfcf7b1b 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 @@ -267,12 +267,7 @@ CREATE TABLE IF NOT EXISTS DM_POLICY_COMPLIANCE_STATUS ( LAST_SUCCESS_TIME TIMESTAMP NULL, LAST_REQUESTED_TIME TIMESTAMP NULL, LAST_FAILED_TIME TIMESTAMP NULL, - ATTEMPTS INTEGER NULL, - CONSTRAINT FK_POLICY_COMPLIANCE_STATUS_POLICY - FOREIGN KEY (POLICY_ID) - REFERENCES DM_POLICY (ID) - ON DELETE NO ACTION - ON UPDATE NO ACTION + ATTEMPTS INTEGER NULL ); CREATE TABLE IF NOT EXISTS DM_POLICY_CHANGE_MGT (