Closed mwfarb closed 8 years ago
I started doing something on these lines.
Here is the code I added for database update. It uses SQLite's PRAGMA user_version.
We never used the user_version
so initially it is 0
. I added a constant CURRENT_DATABASE_VERSION
and if the user_version
is less than the current version, it calls the appropriate patch methods.
It would be great to include a mechanism internally for database upgrade detection that isn't tied to the full application version. Maybe we can include a new field in the .plist or something so that the upgrade process can flow smoothly for developers (like me!) on a per-commitment basis.
This idea being, if we commit a change in logic that requires a database schema change, the commitment should include a version check against that .plist variable (which we would rev in the same commit) to determine in the database needs to be updated or not before loading.