How can I do migration using this library
Closed this issue · 5 comments
a1993k commented
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?
humazed commented
It's not clear what do you mean by pre-filled data?
do you have the data in a .db file?
a1993k commented
yes there is data in db.
version 1 have some data for ex 1 table with 4 rows.
now version 5 have 6 rows then how can I do migration?
…On Fri, Jul 20, 2018, 4:06 PM Ibrahim Eid ***@***.***> wrote:
It's not clear what do you mean by pre-filled data?
do you have the data in a .db file?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#12 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABJrCd5cjVzRrDX5ROFn0h7o4p23Z2eLks5uIbKWgaJpZM4VXo_e>
.
humazed commented
You just need to update your entities and increment database version
humazed commented
and use
val db = RoomAsset.databaseBuilder(applicationContext, AppDatabase::class.java, "chinook.db")
.fallbackToDestructiveMigration()
.build()
a1993k commented
ok.
Thanks for your quick response.
I will check it out.
…On Fri, Jul 20, 2018, 4:26 PM Ibrahim Eid ***@***.***> wrote:
and use
val db = RoomAsset.databaseBuilder(applicationContext, AppDatabase::class.java, "chinook.db")
.fallbackToDestructiveMigration()
.build()
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#12 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABJrCd3nPVqYQ7uqkHCV6lvuyFZnMAmSks5uIbdOgaJpZM4VXo_e>
.