|
|
|
@ -40,18 +40,26 @@ public final class IotDeviceManagementSchemaInitializer extends DatabaseCreator
|
|
|
|
|
CarbonUtils.getCarbonHome() + File.separator + "dbscripts" + File.separator
|
|
|
|
|
+ IotPluginConstants.IOT_DB_SCRIPTS_FOLDER +
|
|
|
|
|
File.separator + "plugins" + File.separator;
|
|
|
|
|
private String pluginType;
|
|
|
|
|
|
|
|
|
|
public IotDeviceManagementSchemaInitializer(DataSource dataSource) {
|
|
|
|
|
public String getPluginType() {
|
|
|
|
|
return pluginType;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public IotDeviceManagementSchemaInitializer(DataSource dataSource, String pType) {
|
|
|
|
|
super(dataSource);
|
|
|
|
|
this.pluginType = pType;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected String getDbScriptLocation(String databaseType) {
|
|
|
|
|
String scriptName = databaseType + ".sql";
|
|
|
|
|
String scriptLocation = setupSQLScriptBaseLocation + this.getPluginType() + File.separator + scriptName;
|
|
|
|
|
if (log.isDebugEnabled()) {
|
|
|
|
|
log.debug("Loading database script from :" + scriptName);
|
|
|
|
|
log.debug("Loading database script from :" + scriptLocation);
|
|
|
|
|
}
|
|
|
|
|
//TODO:test
|
|
|
|
|
return setupSQLScriptBaseLocation.replaceFirst("DBTYPE", databaseType) + scriptName;
|
|
|
|
|
// return setupSQLScriptBaseLocation.replaceFirst("DBTYPE", databaseType) + scriptName;
|
|
|
|
|
return scriptLocation;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|