changing some database related settings for consistency with our other apps

This commit is contained in:
tibbi 2021-09-24 22:42:32 +02:00
parent 3baf841211
commit 44052fec76

View File

@ -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
}
}
}