Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do I need to increment the Room Database version number if I only changed the DAO's, not the entities?

I was just wondering if you really need to increment the room database version number if you changed only the Data Access Objects (DAO's).

So the scenario is:

  1. I already published the app in the Play Store with version x
  2. I only changed part of some DAO's without changing the entities themselves
  3. I incremented the app version code and name (maybe unrelated)

Do I need to increment the room database version number?

like image 390
adco4117 Avatar asked Oct 26 '25 03:10

adco4117


1 Answers

Do I need to increment the room database version number?

You need to increment the schema version when you change the schema. Simply adding functions to a DAO should not result in a schema change. However, your schema might change by things beyond your DAO and your entities. Right now, I think only @DatabaseView would have that effect in terms of annotations, and I do not see anything in RoomDatabase.Builder that should have an effect (other than addMigrations(), which specifically is for version number changes).

like image 136
CommonsWare Avatar answered Oct 28 '25 15:10

CommonsWare



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!