mirror of
https://github.com/SimpleMobileTools/Simple-Clock.git
synced 2024-12-16 18:29:26 +01:00
changing some database related settings for consistency with our other apps
This commit is contained in:
parent
3baf841211
commit
44052fec76
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user