you should not rely on reinstalling the app. when sending to production, you will not be able to request users to reinstall in full. in order to update, after changing the version, you need to provide migration objects that reflect your changes and that are applied when the app starts after the update:
// empty migration, just so you understand how it works
private val MIGRATION_1_2: Migration = object : Migration(1, 2) {
override fun migrate(database: SupportSQLiteDatabase) {}
}
// added a new value in the data class so i am adding it in the database too
private val MIGRATION_2_3: Migration = object : Migration(2, 3) {
override fun migrate(database: SupportSQLiteDatabase) {
database.execSQL("ALTER TABLE yourTableName ADD COLUMN someNewColumn INTEGER")
}
}
After doing these, you need to add them to the databaseBuilder as :
Room.databaseBuilder(.....)
.addMigrations(
MIGRATION_1_2,
MIGRATION_2_3)
.build()