Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Provides
- @Singleton
- fun providesDatabase(): AppDatabase {
- Timber.d("DB_ACCESS - Provided database here")
- return Room.databaseBuilder(
- app,
- AppDatabase::class.java,
- SEEZ_APP_DB_NAME
- ).addCallback(object : RoomDatabase.Callback() {
- override fun onCreate(db: SupportSQLiteDatabase) {
- super.onCreate(db)
- Timber.d("Database created")
- }
- override fun onOpen(db: SupportSQLiteDatabase) {
- super.onOpen(db)
- Timber.d("Database open")
- }
- })
- // .addMigrations(MIGRATION_3_4, MIGRATION_4_5 )
- .fallbackToDestructiveMigration()
- .build()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement