So my app has a sqlite3 database with several tables. Some stables contain "static" data (i.e., it is reference data that the user doesn't change). There are also "dynamic" tables that are affected by actions the user takes in the app. The dynamic tables refer to static tables (via foreign keys), hence my need for a relational DB.
So my question is this... When I want to publish version 2.0 of my app, I may want to change the schemas or the even data contained in the static tables, but I don't want to blow away the user's data in the dynamic tables. Therefore I don't want to just overwrite the existing DB with the new one that is in the App's bundle.
I have developed some code to copy over dynamic table data to the new upgraded DB, but it is rather cumbersome and complex. I'm also worried about maintainability as schemas evolve over time.
Thanks in advance.
So my question is this... When I want to publish version 2.0 of my app, I may want to change the schemas or the even data contained in the static tables, but I don't want to blow away the user's data in the dynamic tables. Therefore I don't want to just overwrite the existing DB with the new one that is in the App's bundle.
Does anyone have any "best practices" or experiences that they want to share on how to effectively upgrade a sqlite3 database file when you publish & deploy your app's next version?
I have developed some code to copy over dynamic table data to the new upgraded DB, but it is rather cumbersome and complex. I'm also worried about maintainability as schemas evolve over time.
Thanks in advance.