Was modified classes to config and create DB for EntityView model

This commit is contained in:
viktorbasanets 2018-09-03 19:30:48 +03:00
parent 1f60a19dac
commit 8fdfa909db
3 changed files with 20 additions and 0 deletions

View File

@ -88,6 +88,13 @@ public class ThingsboardInstallService {
dataUpdateService.updateData("1.4.0");
case "2.0.0":
log.info("Upgrading ThingsBoard from version 2.0.0 to 2.1.1 ...");
databaseUpgradeService.upgradeDatabase("2.0.0");
dataUpdateService.updateData("2.0.0");
log.info("Updating system data...");
systemDataLoaderService.deleteSystemWidgetBundle("charts");

View File

@ -49,6 +49,10 @@ public class DefaultDataUpdateService implements DataUpdateService {
log.info("Updating data from version 1.4.0 to 2.0.0 ...");
tenantsDefaultRuleChainUpdater.updateEntities(null);
break;
case "2.0.0":
log.info("Updating data from version 2.0.0 to 2.1.1 ...");
tenantsDefaultRuleChainUpdater.updateEntities(null);
break;
default:
throw new RuntimeException("Unable to update data, unsupported fromVersion: " + fromVersion);
}

View File

@ -107,6 +107,15 @@ public class SqlDatabaseUpgradeService implements DatabaseUpgradeService {
log.info("Schema updated.");
}
break;
case "2.0.0":
try (Connection conn = DriverManager.getConnection(dbUrl, dbUserName, dbPassword)) {
log.info("Updating schema ...");
schemaUpdateFile = Paths.get(installScripts.getDataDir(), "upgrade", "2.1.1", SCHEMA_UPDATE_SQL);
loadSql(schemaUpdateFile, conn);
log.info("Schema updated.");
}
break;
default:
throw new RuntimeException("Unable to upgrade SQL database, unsupported fromVersion: " + fromVersion);
}