Browse Source

Fix for entity view keys sql field

pull/1240/head
Volodymyr Babak 8 years ago
parent
commit
0eff2acd5c
  1. 2
      application/src/main/data/upgrade/2.2.0/schema_update.sql
  2. 17
      application/src/main/data/upgrade/2.2.1/schema_update.sql
  3. 6
      application/src/main/java/org/thingsboard/server/install/ThingsboardInstallService.java
  4. 8
      application/src/main/java/org/thingsboard/server/service/install/SqlDatabaseUpgradeService.java

2
application/src/main/data/upgrade/2.2.0/schema_update.sql

@ -15,3 +15,5 @@
--
ALTER TABLE component_descriptor ADD UNIQUE (clazz);
ALTER TABLE entity_view ALTER COLUMN keys SET DATA TYPE varchar(10000000);

17
application/src/main/data/upgrade/2.2.1/schema_update.sql

@ -1,17 +0,0 @@
--
-- Copyright © 2016-2018 The Thingsboard Authors
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
--
ALTER TABLE entity_view ALTER COLUMN keys SET DATA TYPE varchar(10000000);

6
application/src/main/java/org/thingsboard/server/install/ThingsboardInstallService.java

@ -101,17 +101,11 @@ public class ThingsboardInstallService {
log.info("Upgrading ThingsBoard from version 2.1.1 to 2.1.2 ...");
databaseUpgradeService.upgradeDatabase("2.1.1");
case "2.1.3":
log.info("Upgrading ThingsBoard from version 2.1.3 to 2.2.0 ...");
databaseUpgradeService.upgradeDatabase("2.1.3");
case "2.2.0":
log.info("Upgrading ThingsBoard from version 2.2.0 to 2.2.1 ...");
databaseUpgradeService.upgradeDatabase("2.2.0");
log.info("Updating system data...");
systemDataLoaderService.deleteSystemWidgetBundle("charts");

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

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

Loading…
Cancel
Save