From f50e9cebdbee284d04ae2406e91266d7f68549f9 Mon Sep 17 00:00:00 2001 From: prabathabey Date: Wed, 10 Dec 2014 18:07:01 +0530 Subject: [PATCH] Fixing issues in reading the SQL script associated with CDM related functionalities --- .../mgt/core/util/DeviceManagementSchemaInitializer.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/util/DeviceManagementSchemaInitializer.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/util/DeviceManagementSchemaInitializer.java index 4ed4e8ad5d..448ae42007 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/util/DeviceManagementSchemaInitializer.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/util/DeviceManagementSchemaInitializer.java @@ -27,18 +27,19 @@ import java.io.File; public final class DeviceManagementSchemaInitializer extends DatabaseCreator { private static final Log log = LogFactory.getLog(DeviceManagementSchemaInitializer.class); - private static final String setupSQLScriptLocation = CarbonUtils.getCarbonHome() + File.separator + "dbscripts" ; + private static final String setupSQLScriptBaseLocation = + CarbonUtils.getCarbonHome() + File.separator + "dbscripts" + File.separator + "cdm" + File.separator; public DeviceManagementSchemaInitializer(DataSourceConfig config) { super(DeviceManagerUtil.resolveDataSource(config)); } protected String getDbScriptLocation(String databaseType) { - String scriptName = "wso2_cdm_" + databaseType + ".sql"; + String scriptName = databaseType + ".sql"; if (log.isDebugEnabled()) { log.debug("Loading database script from :" + scriptName); } - return setupSQLScriptLocation.replaceFirst("DBTYPE", databaseType) + scriptName; + return setupSQLScriptBaseLocation.replaceFirst("DBTYPE", databaseType) + scriptName; } }