Arpit Shukla
Arpit Shukla

Reputation: 10493

When does room start applying migrations?

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?

Please help.

Upvotes: 0

Views: 266

Answers (1)

Harry
Harry

Reputation: 353

Whenever that Room database instance is built. Like when calling "Room.databaseBuilder" method. https://developer.android.com/training/data-storage/room/migrating-db-versions

Upvotes: 1

Related Questions