Special

Clearance Sale!

We've been publishing for over five years now and it's time to clear out our inventory of back issues, so we're slashing prices!

RBD Magazines

Check out this amazing clearance sale of all our past issues. Missing some issues? This is a great time to complete your RBD collection. Save up to 40% off the regular price of our printed back issue packages. These prices are only good until the end of the year May 2008 and supplies are limited, so place your order today.

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.


 


|

 


Weblog Commenting and Trackback by HaloScan.com