|
15 | 15 |
|
16 | 16 | public class Migrations { |
17 | 17 | private static EntityModel model = Models.DEFAULT; |
18 | | - public static int CURRENT_VERSION = 106; |
| 18 | + public static int CURRENT_VERSION = 107; |
19 | 19 |
|
20 | 20 | private static void createVersionTable(Connection c, int version) throws SQLException { |
21 | 21 | Statement s2 = c.createStatement(); |
@@ -434,6 +434,11 @@ public static void migrate(DataSource dataSource, boolean dbIsNew) throws SQLExc |
434 | 434 | execIgnore(c, "ALTER TABLE receiptline ADD tax_code TEXT NULL;", new String[] {"duplicate column name", "already exists", "existiert bereits"}); |
435 | 435 | updateVersionTable(c, 106); |
436 | 436 | } |
| 437 | + if (db_version < 107) { |
| 438 | + // Version 4.3.6 contained a bug that wrote stringified null into this column. |
| 439 | + execIgnore(c, "UPDATE ReceiptLine SET tax_code = NULL WHERE tax_code = 'null';", new String[] {"no such column", "existiert", "syntax error"}); |
| 440 | + updateVersionTable(c, 107); |
| 441 | + } |
437 | 442 |
|
438 | 443 | // Note that the Android app currently does not use these queries! |
439 | 444 |
|
@@ -482,6 +487,11 @@ public static void android_manual_migrations(Connection c, int oldVersion, int n |
482 | 487 | execIgnore(c, "ALTER TABLE settings DROP COLUMN covid_certificates_allow_vaccinated_products;", new String[] {"no such column", "existiert", "syntax error"}); |
483 | 488 | updateVersionTable(c, 105); |
484 | 489 | } |
| 490 | + if (oldVersion < 107 && newVersion >= 107) { |
| 491 | + // Version 4.3.6 contained a bug that wrote stringified null into this column. |
| 492 | + execIgnore(c, "UPDATE ReceiptLine SET tax_code = NULL WHERE tax_code = 'null';", new String[] {"no such column", "existiert", "syntax error"}); |
| 493 | + updateVersionTable(c, 107); |
| 494 | + } |
485 | 495 | } |
486 | 496 |
|
487 | 497 | private static void create_drop(DataSource dataSource) { |
|
0 commit comments