File tree 1 file changed +20
-0
lines changed
libpretixsync/src/main/java/eu/pretix/libpretixsync/sqldelight
1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change
1
+ package eu.pretix.libpretixsync.sqldelight
2
+
3
+ import app.cash.sqldelight.db.AfterVersion
4
+
5
+ object Migrations {
6
+ /* *
7
+ * Lowest schema version that we can still migrate from
8
+ */
9
+ const val minSupportedVersion = 91L
10
+
11
+ /* *
12
+ * AfterVersion callback that can be used in SQLDelight code migrations to crash if we encounter
13
+ * a schema version that we have no migrations for.
14
+ * Without it, SQLDelight might just increase the DB version without actually creating the
15
+ * correct schema.
16
+ */
17
+ val minVersionCallback = AfterVersion (minSupportedVersion - 1L ) { _ ->
18
+ throw IllegalStateException (" Unsupported database version. Minimum supported version is $minSupportedVersion " )
19
+ }
20
+ }
You can’t perform that action at this time.
0 commit comments