Q:

How to update sqlite database when updating the version to Appstore.

I am using the Sqlite Database in my Application,
I have already upload my application to Appstore,
I have made some changes in my database and upload the second version of the Application.  Now any user install the Application. Is there any way to make database changes without uninstalling the previous version of Application?
My sqlite database file is stored in Document directory folder.
How can i do this?

A:

You will need to perform a database migration. This means the updated version of your app should check for the existance of the older database.
If it finds one, it should perform all the necessary ALTER TABLE ... or CREATE TABLE ... etc.  statements required to update the database to the new schema.
Depending on the number and types of changes you have made, this could be easy or difficult for you. But as long as the data is there you should be able to migrate it, even if you totally redesigned the database schema.
I would highly recommend you take a TDD approach, or at least write some unit tests to test the migration process. The last thing you want is for users to lose their data.

