humazed/RoomAsset

How can I do migration using this library

Closed this issue · 5 comments

I have one app with some pre-filled data.
now in-app update I need to replace the old DB file with the new one from the asset.
Is it done by the library or I need to do extra effort?

It's not clear what do you mean by pre-filled data?
do you have the data in a .db file?

You just need to update your entities and increment database version

and use

  val db = RoomAsset.databaseBuilder(applicationContext, AppDatabase::class.java, "chinook.db")
        .fallbackToDestructiveMigration()
        .build()