Showing
1 changed file
with
7 additions
and
0 deletions
... | ... | @@ -30,6 +30,7 @@ import java.nio.file.Path; |
30 | 30 | import java.nio.file.Paths; |
31 | 31 | import java.sql.Connection; |
32 | 32 | import java.sql.DriverManager; |
33 | +import java.sql.SQLSyntaxErrorException; | |
33 | 34 | |
34 | 35 | import static org.thingsboard.server.service.install.DatabaseHelper.ADDITIONAL_INFO; |
35 | 36 | import static org.thingsboard.server.service.install.DatabaseHelper.ASSIGNED_CUSTOMERS; |
... | ... | @@ -213,6 +214,12 @@ public class SqlDatabaseUpgradeService implements DatabaseEntitiesUpgradeService |
213 | 214 | try { |
214 | 215 | conn.createStatement().execute("ALTER TABLE attribute_kv ADD COLUMN json_v json;"); |
215 | 216 | } catch (Exception e) { |
217 | + if (e instanceof SQLSyntaxErrorException) { | |
218 | + try { | |
219 | + conn.createStatement().execute("ALTER TABLE attribute_kv ADD COLUMN json_v varchar(10000000);"); | |
220 | + } catch (Exception e1) { | |
221 | + } | |
222 | + } | |
216 | 223 | } |
217 | 224 | try { |
218 | 225 | conn.createStatement().execute("ALTER TABLE dashboard ALTER COLUMN configuration SET DATA TYPE varchar(100000000);"); //NOSONAR, ignoring because method used to execute thingsboard database upgrade script | ... | ... |