From 466d7d7b161ec9b510cb0cbb736323cbea07e134 Mon Sep 17 00:00:00 2001 From: Philipp Heckel Date: Tue, 16 Nov 2021 14:35:03 -0500 Subject: [PATCH] Fix migration --- app/src/main/java/io/heckel/ntfy/data/Database.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/io/heckel/ntfy/data/Database.kt b/app/src/main/java/io/heckel/ntfy/data/Database.kt index 52ce86b..0704aad 100644 --- a/app/src/main/java/io/heckel/ntfy/data/Database.kt +++ b/app/src/main/java/io/heckel/ntfy/data/Database.kt @@ -69,7 +69,7 @@ abstract class Database : RoomDatabase() { override fun migrate(db: SupportSQLiteDatabase) { // Drop "notifications" & "lastActive" columns (SQLite does not support dropping columns, ...) db.execSQL("CREATE TABLE Subscription_New (id INTEGER NOT NULL, baseUrl TEXT NOT NULL, topic TEXT NOT NULL, instant INTEGER NOT NULL DEFAULT('0'), PRIMARY KEY(id))") - db.execSQL("INSERT INTO Subscription_New SELECT id, baseUrl, topic FROM Subscription") + db.execSQL("INSERT INTO Subscription_New SELECT id, baseUrl, topic, 0 FROM Subscription") db.execSQL("DROP TABLE Subscription") db.execSQL("ALTER TABLE Subscription_New RENAME TO Subscription") db.execSQL("CREATE UNIQUE INDEX index_Subscription_baseUrl_topic ON Subscription (baseUrl, topic)")