Reputation: 1045
I don't want to upgrade the database version but I want to change some values of a column when I release a new version of my android app. where is the right place for writing update query?
Upvotes: 0
Views: 45
Reputation:
SQLiteOpenHelper not really help you as it not know you want changes made. It designed to see database version.
So the place is when you open the database and then after you have checked if the changes need to be made else every time App starts changes would be done.
You could be introduce a table to save data about the changes. It could be checked to see is the changes has been applied. At first if the table does not exist then first updates would be applied.
You could have the App override onOpen or onConfigure for the App release for the specific release you have to consider new install verse old.
Amount of data and hardness could decide right way. A lot of data and you could have issue if check would be all data. So small table, even 1 row could be way to go.
Upvotes: 1