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

This commit is contained in:
Michael Bayne
2008-10-22 01:09:22 +00:00
parent 19287550f4
commit ba97743754
@@ -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