Skip to content

Commit 4961670

Browse files
committed
Move manual migration from SyncManager to android_manual_migrations
1 parent 6908d81 commit 4961670

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

libpretixsync/src/main/java/eu/pretix/libpretixsync/db/Migrations.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,9 @@ public static void migrate(DataSource dataSource, boolean dbIsNew) throws SQLExc
440440
}
441441

442442
public static void android_manual_migrations(Connection c, int oldVersion, int newVersion) throws SQLException {
443+
if (oldVersion < 58 && newVersion >= 58) {
444+
execIgnore(c, "UPDATE checkin SET listId = list WHERE (listId IS NULL OR listID = 0) AND list IS NOT NULL AND list > 0", new String[] {"no such column", "existiert", "syntax error"});
445+
}
443446
if (oldVersion < 87 && newVersion >= 87) {
444447
execIgnore(c, "CREATE INDEX receipt_open ON receipt (open) WHERE open = 1;", new String[] {"already exists", "existiert bereits"});
445448
}

libpretixsync/src/main/java/eu/pretix/libpretixsync/sync/SyncManager.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -306,13 +306,6 @@ private void bumpKnownVersion() {
306306
configStore.setLastFailedSync(System.currentTimeMillis());
307307
configStore.setLastFailedSyncMsg(e.getMessage());
308308
}
309-
310-
// This is kind of a manual migration, added in 2020-19. Remove at some late point in time
311-
try {
312-
dataStore.raw("UPDATE checkin SET listId = list WHERE (listId IS NULL OR listID = 0) AND list IS NOT NULL AND list > 0");
313-
} catch (Exception e) {
314-
// old column doesn't exist? ignore!
315-
}
316309
}
317310

318311
protected void upload(ProgressFeedback feedback) throws SyncException {

0 commit comments

Comments
 (0)