From 44052fec76740c9514f9f7529b642d5524c3e748 Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 24 Sep 2021 22:42:32 +0200 Subject: [PATCH] changing some database related settings for consistency with our other apps --- .../com/simplemobiletools/clock/databases/AppDatabase.kt | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/clock/databases/AppDatabase.kt b/app/src/main/kotlin/com/simplemobiletools/clock/databases/AppDatabase.kt index 9752b84f..754130e7 100644 --- a/app/src/main/kotlin/com/simplemobiletools/clock/databases/AppDatabase.kt +++ b/app/src/main/kotlin/com/simplemobiletools/clock/databases/AppDatabase.kt @@ -26,6 +26,7 @@ abstract class AppDatabase : RoomDatabase() { synchronized(AppDatabase::class) { if (db == null) { db = Room.databaseBuilder(context.applicationContext, AppDatabase::class.java, "app.db") + .fallbackToDestructiveMigration() .addCallback(object : Callback() { override fun onCreate(db: SupportSQLiteDatabase) { super.onCreate(db) @@ -33,7 +34,6 @@ abstract class AppDatabase : RoomDatabase() { } }) .build() - db!!.openHelper.setWriteAheadLoggingEnabled(true) } } } @@ -58,9 +58,5 @@ abstract class AppDatabase : RoomDatabase() { ) } } - - fun destroyInstance() { - db = null - } } }