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) {