From a390df68eccdb9f683fb198cadaa031e53a32e80 Mon Sep 17 00:00:00 2001 From: pasinduj Date: Tue, 8 Dec 2015 11:42:04 +0530 Subject: [PATCH] modified dbscripts to remove foriegn key reference --- .../wso2/carbon/policy/mgt/core/dao/impl/PolicyDAOImpl.java | 4 ++-- .../src/main/resources/dbscripts/cdm/h2.sql | 4 ++-- .../src/main/resources/dbscripts/cdm/mysql.sql | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/dao/impl/PolicyDAOImpl.java b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/dao/impl/PolicyDAOImpl.java index f78feca333..cd886a4368 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/dao/impl/PolicyDAOImpl.java +++ b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/dao/impl/PolicyDAOImpl.java @@ -1282,11 +1282,11 @@ public class PolicyDAOImpl implements PolicyDAO { stmt.setInt(1, policyId); stmt.executeUpdate(); - String deleteComplianceStatus ="DELETE FROM DM_POLICY_COMPLIANCE_STATUS WHERE POLICY_ID =?"; + /* String deleteComplianceStatus ="DELETE FROM DM_POLICY_COMPLIANCE_STATUS WHERE POLICY_ID =?"; stmt = conn.prepareStatement(deleteComplianceStatus); stmt.setInt(1, policyId); stmt.executeUpdate(); - + */ if (log.isDebugEnabled()) { log.debug("Policy (" + policyId + ") related configs deleted from database."); } 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 2ef6a29220..3c8b0cd88e 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 @@ -309,9 +309,9 @@ CREATE TABLE IF NOT EXISTS DM_POLICY_COMPLIANCE_STATUS ( LAST_FAILED_TIME TIMESTAMP NULL, ATTEMPTS INT NULL, PRIMARY KEY (ID), - CONSTRAINT FK_POLICY_COMPLIANCE_STATUS_POLICY + /*CONSTRAINT FK_POLICY_COMPLIANCE_STATUS_POLICY FOREIGN KEY (POLICY_ID) - REFERENCES DM_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 e340450d4c..32c2e9f7e6 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 @@ -297,9 +297,9 @@ CREATE TABLE IF NOT EXISTS DM_POLICY_COMPLIANCE_STATUS ( 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) + /* CONSTRAINT FK_POLICY_COMPLIANCE_STATUS_POLICY + FOREIGN KEY (POLICY_ID) + REFERENCES DM_POLICY (ID)*/ ON DELETE NO ACTION ON UPDATE NO ACTION )ENGINE = InnoDB;