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 4ed4e8ad5d5..448ae42007e 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; } }