I’m thinking about creating an app with Xojo that manages data. I’ve been reading up on using databases within Xojo and I’ve created some basic apps so far but one thing occurred to me that I haven’t seen anyone here discuss… and that’s ‘versioning’.
Specifically, how to handle existing data files as your application grows and improves with each version that you release. For the purposes of this conversation, let’s assume that we’re using the database server that’s built in to Xojo and not an external database server; and that we’re saving our database to a file in our Documents folder. (Think about something like QuickBooks) Every time we open the app, we choose a database file and open it to view and manage what’s inside.
But what happens when the new version of your app uses a slightly altered version of your database schema? Upon opening the data file, it needs to recognize that it’s schema is out of date and update it without destroying any data.
While version 1.0 may declare the entire schema with a series of complete CREATE commands (and certainly new files could be created that way), the application must track each modification that occurred between 1.0 and 1.1… and apply it to a data file that was created with 1.0 in order to upgrade it to a datafile that will work with version 1.1 of your software.
Before I go and develop a whole versioning system, I thought that I’d put this out here and ask if I’m reinventing the wheel or not. Does anyone have any experience with this? Does something already exist that I should consider using? Even general feedback and ideas of how you might do this would be appreciated.