fixed logic in upgrade script to use additionalActions instead of new connection
This commit is contained in:
parent
a869638e59
commit
28bc02132b
@ -759,26 +759,14 @@ public class SqlDatabaseUpgradeService implements DatabaseEntitiesUpgradeService
|
|||||||
updateSchema("3.6.0", 3006000, "3.6.1", 3006001, null);
|
updateSchema("3.6.0", 3006000, "3.6.1", 3006001, null);
|
||||||
break;
|
break;
|
||||||
case "3.6.1":
|
case "3.6.1":
|
||||||
updateSchema("3.6.1", 3006001, "3.6.2", 3006002, null);
|
updateSchema("3.6.1", 3006001, "3.6.2", 3006002, connection -> {
|
||||||
break;
|
try {
|
||||||
case "3.6.1":
|
Path saveAttributesNodeUpdateFile = Paths.get(installScripts.getDataDir(), "upgrade", "3.6.1", "save_attributes_node_update.sql");
|
||||||
try (Connection conn = DriverManager.getConnection(dbUrl, dbUserName, dbPassword)) {
|
loadSql(saveAttributesNodeUpdateFile, connection);
|
||||||
if (isOldSchema(conn, 3006001)) {
|
} catch (Exception e) {
|
||||||
log.info("Updating schema ...");
|
log.warn("Failed to execute update script for save attributes rule nodes due to: ", e);
|
||||||
try {
|
|
||||||
Path saveAttributesNodeUpdateFile = Paths.get(installScripts.getDataDir(), "upgrade", "3.6.1", "save_attributes_node_update.sql");
|
|
||||||
loadSql(saveAttributesNodeUpdateFile, conn);
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.warn("Failed to execute update script for save attributes rule nodes due to: ", e);
|
|
||||||
}
|
|
||||||
conn.createStatement().execute("UPDATE tb_schema_settings SET schema_version = 3006002;");
|
|
||||||
log.info("Schema updated to version 3.6.2.");
|
|
||||||
} else {
|
|
||||||
log.info("Skip schema re-update to version 3.6.2. Use env flag 'SKIP_SCHEMA_VERSION_CHECK' to force the re-update.");
|
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
});
|
||||||
log.error("Failed updating schema!!!", e);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw new RuntimeException("Unable to upgrade SQL database, unsupported fromVersion: " + fromVersion);
|
throw new RuntimeException("Unable to upgrade SQL database, unsupported fromVersion: " + fromVersion);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user