Reputation: 2954
I'm going to be using a SQLite3 DB (after being told about them earlier today) for saving player progress through various worlds and levels in my game.
I was wondering how I would go about updating the database in a update to the game. So, I release V1.0 which has 10 levels and 1 world, if I then wish to update the DB to have 20 levels and two worlds in a v2.0 release in iTunes six months later, whilst preserving the data in the DB such as the player's score on each level to date, how would I go about that?
My understanding was that the DB is deployed with the app, so part of my question is, what happens when there is already a DB present? Also, how can I avoid overwriting the DB on the device and perform a smooth update procedure for the user?
For reference, I'm using this wrapper.
Upvotes: 0
Views: 60
Reputation: 11197
You can update it without removing the old database. If you database is in main bundle it will be removed but if it is in document directory it will not be remove while updating the application.
Assuming you db is in document directory, You can update you database without any problem, it fully depends on your implementation. You can easily insert your new levels & new world, just be careful about you implementation, do not replace or drop any previous table.
I had asked a similar question before see this. Hope this helps.. :)
Upvotes: 1