|
|
|
@ -638,7 +638,8 @@ public class SqlDatabaseUpgradeService implements DatabaseEntitiesUpgradeService |
|
|
|
futures.add(dbUpgradeExecutor.submit(() -> { |
|
|
|
try { |
|
|
|
assetProfileService.createDefaultAssetProfile(tenantId); |
|
|
|
} catch (Exception e) {} |
|
|
|
} catch (Exception e) { |
|
|
|
} |
|
|
|
})); |
|
|
|
} |
|
|
|
Futures.allAsList(futures).get(); |
|
|
|
@ -657,7 +658,8 @@ public class SqlDatabaseUpgradeService implements DatabaseEntitiesUpgradeService |
|
|
|
futures.add(dbUpgradeExecutor.submit(() -> { |
|
|
|
try { |
|
|
|
assetProfileService.findOrCreateAssetProfile(tenantId, assetType); |
|
|
|
} catch (Exception e) {} |
|
|
|
} catch (Exception e) { |
|
|
|
} |
|
|
|
})); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -734,12 +736,14 @@ public class SqlDatabaseUpgradeService implements DatabaseEntitiesUpgradeService |
|
|
|
schemaUpdateFile = Paths.get(installScripts.getDataDir(), "upgrade", "3.5.1", SCHEMA_UPDATE_SQL); |
|
|
|
loadSql(schemaUpdateFile, conn); |
|
|
|
|
|
|
|
try { |
|
|
|
String [] entityNames = new String [] {"device", "component_descriptor", "customer", "dashboard", "rule_chain", "rule_node", "asset_profile", "asset", "device_profile", "tb_user", "tenant_profile", "tenant", "widgets_bundle", "entity_view", "edge"}; |
|
|
|
for (String entityName : entityNames) { |
|
|
|
String[] entityNames = new String[]{"device", "component_descriptor", "customer", "dashboard", "rule_chain", "rule_node", "ota_package", |
|
|
|
"asset_profile", "asset", "device_profile", "tb_user", "tenant_profile", "tenant", "widgets_bundle", "entity_view", "edge"}; |
|
|
|
for (String entityName : entityNames) { |
|
|
|
try { |
|
|
|
conn.createStatement().execute("ALTER TABLE " + entityName + " DROP COLUMN " + SEARCH_TEXT + " CASCADE"); |
|
|
|
} catch (Exception e) { |
|
|
|
} |
|
|
|
} catch (Exception e) {} |
|
|
|
} |
|
|
|
|
|
|
|
conn.createStatement().execute("UPDATE tb_schema_settings SET schema_version = 3005002;"); |
|
|
|
} |
|
|
|
|