mercredi 16 septembre 2015

How to migrate changes in SQLite file into an existing app?

I've submitted an iOS app with SQLite database file to store data inside the app.

Now in next version of the app – I have some modifications in a database file.

Like,

  1. Added new tables (1 empty, 2 with fixed data)
  2. Added new columns in a table
  3. Removed existing columns from a table

What, I thinking?

I'll add a new database file (which included all changes) in my app, at first run of the app (after update) I'll check for the existence of an old database file, if available, will append everything from old to new file and lastly will delete the old file.

Is this the right way or there can be a more significant way like Core Data migration Or other more appropriate way?

Aucun commentaire:

Enregistrer un commentaire