From 916dfb3cfa92dfc80025988903ec0d294a9c4985 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Tue, 30 Jan 2007 22:40:24 +0000 Subject: [PATCH] --- src/java/com/samskivert/jdbc/depot/DepotMarshaller.java | 1 + src/java/com/samskivert/jdbc/depot/EntityMigration.java | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/java/com/samskivert/jdbc/depot/DepotMarshaller.java b/src/java/com/samskivert/jdbc/depot/DepotMarshaller.java index 3cbd0c7..da8a302 100644 --- a/src/java/com/samskivert/jdbc/depot/DepotMarshaller.java +++ b/src/java/com/samskivert/jdbc/depot/DepotMarshaller.java @@ -680,6 +680,7 @@ public class DepotMarshaller for (EntityMigration migration : _migrations) { if (migration.runBeforeDefault() && migration.shouldRunMigration(currentVersion, _schemaVersion)) { + migration.init(getTableName(), _fields); ctx.invoke(migration); } } diff --git a/src/java/com/samskivert/jdbc/depot/EntityMigration.java b/src/java/com/samskivert/jdbc/depot/EntityMigration.java index a1400b5..9d21c1e 100644 --- a/src/java/com/samskivert/jdbc/depot/EntityMigration.java +++ b/src/java/com/samskivert/jdbc/depot/EntityMigration.java @@ -119,7 +119,9 @@ public abstract class EntityMigration extends Modifier /** * This is called to provide the migration with the name of the entity table and access to its - * field marshallers prior to being invoked. + * field marshallers prior to being invoked. This will only be called after this + * migration has been determined to be runnable so one cannot rely on this method having been + * called in {@link #shouldRunMigration}. */ protected void init (String tableName, HashMap marshallers) {