LibreTube/app/src/main/java/com/github/libretube/database/DatabaseHolder.kt

20 lines
460 B
Kotlin
Raw Normal View History

2022-08-13 23:34:07 +05:30
package com.github.libretube.database
import android.content.Context
import androidx.room.Room
import com.github.libretube.DATABASE_NAME
object DatabaseHolder {
lateinit var database: AppDatabase
fun initializeDatabase(context: Context) {
database = Room.databaseBuilder(
context,
AppDatabase::class.java,
DATABASE_NAME
2022-08-14 01:33:11 +05:30
)
.fallbackToDestructiveMigration()
.build()
2022-08-13 23:34:07 +05:30
}
}