Consider the following scenario.
I have an iPhone app in the app store which performs queries on a 16 column SQLite3 table. As an update, I want to add a new column to this table.
When someone installs the update, will it mess up? Will the table get replaced? How does this work. How should I handle this?
One way to do it would be to check at launch time if the table has the new field. You can use the following SQLite command to retrieve all fields from a table
If the field you’re looking is not in the result set, execute an
ALTER TABLE table-name ADD COLUMN column-name column-typeto update your table.You can use this method to loop through the fields of a table
Hope this helps