Browse Source

Fix upgrade from version 3.2.2

pull/5493/head
Swoq 5 years ago
committed by Andrii Shvaika
parent
commit
22ce8cf063
  1. 8
      application/src/main/java/org/thingsboard/server/service/install/update/DefaultDataUpdateService.java

8
application/src/main/java/org/thingsboard/server/service/install/update/DefaultDataUpdateService.java

@ -153,12 +153,16 @@ public class DefaultDataUpdateService implements DataUpdateService {
JsonNode createRules = node.get("createRules");
for (AlarmSeverity severity : AlarmSeverity.values()) {
if (createRules.has(severity.name())) {
isUpdated = isUpdated || convertDeviceProfileAlarmRulesForVersion330(createRules.get(severity.name()).get("condition").get("spec"));
JsonNode spec = createRules.get(severity.name()).get("condition").get("spec");
boolean convertResult = convertDeviceProfileAlarmRulesForVersion330(spec);
isUpdated = convertResult || isUpdated;
}
}
}
if (node.has("clearRule") && !node.get("clearRule").isNull()) {
isUpdated = isUpdated || convertDeviceProfileAlarmRulesForVersion330(node.get("clearRule").get("condition").get("spec"));
JsonNode spec = node.get("clearRule").get("condition").get("spec");
boolean convertResult = convertDeviceProfileAlarmRulesForVersion330(spec);
isUpdated = convertResult || isUpdated;
}
}
if (isUpdated) {

Loading…
Cancel
Save