I think there are a couple of ways to do this. The simplest is to specify in a Properties file the models that need to be migrated using a comma separated list of model names. The order in which the names appear is the order in which the migrations will run. For example:
er.migration.modelNames=ERAttachment,MyOtherModel,MyModel
I believe this will migrate completely ERAttachment, then MyOtherModel and finally MyModel (meaning that all migrations for a single model will be completed before moving on to the next). Note that if you don’t specify an order in your Properties file, the order defined by the ordering of the default model group, which is probably not what you want.
If you need more fine-grained control, you can specify specific model version dependencies in your migration class. For example, if MyOtherModel3 should not be run until MyModel1 has been run, you can override the modelDependencies() method in MyOtherModel3.java:
public NSArray<ERXModelVersion> modelDependencies() { return new NSArray<ERXModelVersion>(new ERXModelVersion[]{ new ERXModelVersion(“MyModel”,1 }); }
This should ensure that MyOtherModel3 will run after MyModel1 has completed, even though the order of the migrations in the Properties file lists MyOtherModel before MyModel.
F
—
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
|