I do this by having a table with system information and one
column contains the schema version. This is actually the one place
in my app where I use synchronous DB calls because I don't want the
app to initialize or anything to happen until the schema is at the
correct version. The code looks something like this:
while (currentSchemaNum < requiredSchemaNum)
{
var newSchemaNum:int = currentSchemaNum + 1;
var updateScript:String = "updatefile_" + newSchemaNum +
".sql";
// < run updateScript synchronously >
// this part sucks because you have to parse the script into
individual statements
// and run them one at a time
dbSchemaId = newSchemaNum;
}