From 96d839cd8cfbd30bbd9151b0fad04d1b47d76774 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 17 Dec 2018 14:07:41 +0100 Subject: [PATCH] lets fall back to db recreation on some error, it is better than a crashing app --- .../simplemobiletools/gallery/pro/databases/GalleryDatabase.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/databases/GalleryDatabase.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/databases/GalleryDatabase.kt index 7f0257f9b..b5ac89748 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/databases/GalleryDatabase.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/databases/GalleryDatabase.kt @@ -30,6 +30,7 @@ abstract class GalleryDatabase : RoomDatabase() { synchronized(GalleryDatabase::class) { if (db == null) { db = Room.databaseBuilder(context.applicationContext, GalleryDatabase::class.java, "gallery.db") + .fallbackToDestructiveMigration() .addMigrations(MIGRATION_4_5) .addMigrations(MIGRATION_5_6) .build()