Fixing issues in reading the SQL script associated with CDM related functionalities

revert-dabc3590
prabathabey 10 years ago
parent f321b133b8
commit f50e9cebdb

@ -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;
}
}

Loading…
Cancel
Save