Fixed brokenness on schema reinitialization

This commit is contained in:
Dan Stillman 2006-06-07 14:35:04 +00:00
parent 448fde9ff1
commit 882a96ee40

View file

@ -127,15 +127,15 @@ Scholar.Schema = new function(){
*/ */
function _initializeSchema(){ function _initializeSchema(){
try { try {
beginTransaction(); Scholar.DB.beginTransaction();
var sql = _getSchemaSQL(); var sql = _getSchemaSQL();
query(sql); Scholar.DB.query(sql);
query("INSERT INTO version VALUES (" + _getSchemaSQLVersion() + ")"); Scholar.DB.query("INSERT INTO version VALUES (" + _getSchemaSQLVersion() + ")");
commitTransaction(); Scholar.DB.commitTransaction();
} }
catch(e){ catch(e){
alert(e); alert(e);
rollbackTransaction(); Scholar.DB.rollbackTransaction();
} }
} }