Make sure we use the up to date metadata when doing our stale column check.

git-svn-id: https://samskivert.googlecode.com/svn/trunk@2457 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
samskivert
2008-10-22 01:09:22 +00:00
parent 8ac0e012ce
commit 327b9581b9
@@ -641,9 +641,10 @@ public class DepotMarshaller<T extends PersistentRecord>
if (!metaData.tableExists) {
// if the table does not exist, create it
createTable(ctx, builder, declarations);
metaData = TableMetaData.load(ctx, getTableName());
} else {
// if it does exist, run our migrations
runMigrations(ctx, metaData, builder, currentVersion);
metaData = runMigrations(ctx, metaData, builder, currentVersion);
}
// check for stale columns now that the table is up to date
@@ -720,7 +721,7 @@ public class DepotMarshaller<T extends PersistentRecord>
});
}
protected void runMigrations (PersistenceContext ctx, TableMetaData metaData,
protected TableMetaData runMigrations (PersistenceContext ctx, TableMetaData metaData,
final SQLBuilder builder, int currentVersion)
throws DatabaseException
{
@@ -932,6 +933,8 @@ public class DepotMarshaller<T extends PersistentRecord>
}
});
}
return metaData;
}
// translate an array of field names to an array of column names