Merge with master
This commit is contained in:
commit
2f7b1730d5
23
application/src/main/data/upgrade/3.5.0/schema_update.sql
Normal file
23
application/src/main/data/upgrade/3.5.0/schema_update.sql
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
--
|
||||||
|
-- Copyright © 2016-2023 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.
|
||||||
|
--
|
||||||
|
|
||||||
|
-- FIX DASHBOARD TEMPLATES AFTER ANGULAR MIGRATION TO VER.15
|
||||||
|
|
||||||
|
UPDATE dashboard SET configuration = REPLACE(configuration, 'mat-button mat-icon-button', 'mat-icon-button')
|
||||||
|
WHERE configuration like '%mat-button mat-icon-button%';
|
||||||
|
|
||||||
|
UPDATE widget_type SET descriptor = REPLACE(descriptor, 'mat-button mat-icon-button', 'mat-icon-button')
|
||||||
|
WHERE descriptor like '%mat-button mat-icon-button%';
|
||||||
@ -256,6 +256,7 @@ public class ThingsboardInstallService {
|
|||||||
}
|
}
|
||||||
case "3.5.0":
|
case "3.5.0":
|
||||||
log.info("Upgrading ThingsBoard from version 3.5.0 to 3.5.1 ...");
|
log.info("Upgrading ThingsBoard from version 3.5.0 to 3.5.1 ...");
|
||||||
|
databaseEntitiesUpgradeService.upgradeDatabase("3.5.0");
|
||||||
case "3.5.1":
|
case "3.5.1":
|
||||||
log.info("Upgrading ThingsBoard from version 3.5.1 to 3.5.2 ...");
|
log.info("Upgrading ThingsBoard from version 3.5.1 to 3.5.2 ...");
|
||||||
databaseEntitiesUpgradeService.upgradeDatabase("3.5.1");
|
databaseEntitiesUpgradeService.upgradeDatabase("3.5.1");
|
||||||
|
|||||||
@ -714,10 +714,23 @@ public class SqlDatabaseUpgradeService implements DatabaseEntitiesUpgradeService
|
|||||||
log.error("Failed updating schema!!!", e);
|
log.error("Failed updating schema!!!", e);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "3.5.1":
|
case "3.5.0":
|
||||||
try (Connection conn = DriverManager.getConnection(dbUrl, dbUserName, dbPassword)) {
|
try (Connection conn = DriverManager.getConnection(dbUrl, dbUserName, dbPassword)) {
|
||||||
log.info("Updating schema ...");
|
log.info("Updating schema ...");
|
||||||
if (isOldSchema(conn, 3005000)) {
|
if (isOldSchema(conn, 3005000)) {
|
||||||
|
schemaUpdateFile = Paths.get(installScripts.getDataDir(), "upgrade", "3.5.0", SCHEMA_UPDATE_SQL);
|
||||||
|
loadSql(schemaUpdateFile, conn);
|
||||||
|
conn.createStatement().execute("UPDATE tb_schema_settings SET schema_version = 3005001;");
|
||||||
|
}
|
||||||
|
log.info("Schema updated.");
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("Failed updating schema!!!", e);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "3.5.1":
|
||||||
|
try (Connection conn = DriverManager.getConnection(dbUrl, dbUserName, dbPassword)) {
|
||||||
|
log.info("Updating schema ...");
|
||||||
|
if (isOldSchema(conn, 3005001)) {
|
||||||
schemaUpdateFile = Paths.get(installScripts.getDataDir(), "upgrade", "3.5.1", SCHEMA_UPDATE_SQL);
|
schemaUpdateFile = Paths.get(installScripts.getDataDir(), "upgrade", "3.5.1", SCHEMA_UPDATE_SQL);
|
||||||
loadSql(schemaUpdateFile, conn);
|
loadSql(schemaUpdateFile, conn);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user