Issue
I have an android app which uses Room Persistence library to store data locally. I recently changed schema for my table, updated the database version and added necessary migrations to the database builder.
I am using Dagger Hilt to provide RoomDatabase instance to my ViewModels. I need to do some setup before room actually starts applying migrations.
So I was wondering when does Room start migrating database?
- Is it when the Database instance is built?
- Or when I call some Dao's function the first time.
- Or at some other point?
Please help.
Solution
Whenever that Room database instance is built. Like when calling "Room.databaseBuilder" method. https://developer.android.com/training/data-storage/room/migrating-db-versions
Answered By - Harry
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.