Reputation: 888
During an app update via the App Store I want to update the SQLite database file with more content.
The old SQLite file is in the Documents
folder of my app.
How do I handle this?
Upvotes: 0
Views: 271
Reputation: 21902
I'm assuming you're not using Core Data or else you'd be using the auto-migration feature. For straight SQLLite you'll want to create a new database file. Then depending on the nature of your schema changes, you might be able to execute a query to copy the data over (using INSERT INTO destination SELECT * FROM source
) . But if the changes are too much to handle with a simple set of queries, for example if it involves business logic, then you might need to write a script to convert the old data from one database to the new one.
Upvotes: 1