Sqlite data not updated op App upgrade in Playstore

I already have a released app on Google play store. It contains a Sqlite db in which I update or insert data before the next release. Problem is after a release when the user upgrades my app, the database still contains the old data and a settings -> apps -> “myApp” -> storage -> clear data operation is required before the latest data shows in my app.

Why is this the case and what can I do to get around the issue?

Thank you in advance!

the sqlite database used by the app always is on the device of the user, so if you want to upgrade the database, you have to import the new database… my sqlite extension offers an Import method for that…
https://puravidaapps.com/sqlite.php

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun.

Thanks Taifun.

The problem with import is that it overwrites all the data in the db on the user’s device. I use the import function in the first run of my app. So if the user entered data since the first run an import on my app’s upgrade will overwrite the user’s data.

Seems like the only way I can get around this is to ship a sql file with each upgrade and execute that after an upgrade was done.

Cheers