sqlite DB to-do during iphone app update

后端 未结 3 898
野趣味
野趣味 2020-12-13 22:09

I have some general questions about iphone app updates that involves sqlite db.

  1. With the new update does the existing sqlite db get overwritten with a copy

3条回答
  •  情歌与酒
    2020-12-13 22:56

    1) The database file isn't stored as part of the app bundle so no, it won't get automatically overwritten.

    2) Yes - all their data will be saved. In fact, the database won't get touched at all by the update.

    3) This is the tricky one - read this fantastically interesting document - especially the part on lightweight migration - if your schema changes are small and follow a certain set of rules, they will happen automatically and the user won't notice. however, if ther are major changes to the schema you will have to write your own migration code (that's in that links as well)

    I've always managed to get away with running lightweight migrations myself - it's by far easier than doing it yourself.

提交回复
热议问题