Article Preview
Buy Now
| Print: | |
| PDF: |
Databases
Database Versioning
(Plus GUIDs and SQLITE_MASTER)
Issue: 5.5 (July/August 2007)
Author: Paul Lefebvre
Article Description: No description available.
Article Length (in bytes): 4,006
Starting Page Number: 40
RBD Number: 5513
Resource File(s): None
Related Link(s): None
Known Limitations: None
Excerpt of article text...
This issue we'll cover a few different topics. Let's get started!
Database Versioning
If you have created any sort of application that has a database, you need to think about how you are going to manage your database versions. Some questions to think about include:
How will newer versions of your application work with older versions of the database?
How will you update the database with new columns, tables or data?
Do you want to only allow specific database versions to work with specific application versions?
A common technique to help manage this is to create a table in your database for tracking version information. This would be a simple table, perhaps with only a single column (and a single row):
CREATE TABLE DatabaseVersion (version Text);
Now you can use this to check for application/database compatibility. For example when your application starts, it would ask the database for its version. Based on this information, your code could determine if the application needs to update the database. This is how code to do this might look:
...End of Excerpt. Please purchase the magazine to read the full article.
Article copyrighted by REALbasic Developer magazine. All rights reserved.
|








