Updating iOS Local Database from server

Viewed 842

In iOS, I've had experience working with local-only SQL, and server-only SQL accessed over PHP.

My question is, the app that I'm planning to write will have a local database and a remote database, which is probably pretty common. I'm planning to basically have the iOS app update from certain tables in the server's database.

My question is: Is there a simple or common way to compare the list of columns in a given table, and copy any that are changed or missing from the server to the local database?

Example, if I had a table full of data, and then added a new column on the server, is there a standard way to have the local iOS database reflect that new column?

The idea that I came up with was start both databases as a blank new database, and then any change I add a new SQL script on the server to update the local DB- then, if the iOS device detects a new database revision it would run the update scripts and anything missing would be added. I was just hoping there would be a better way, as this could get messy.

2 Answers
Related