Hi Jeff,

On 14-Apr-09, at 6:28 AM, David Avendasora wrote:

Hi Jeff,

I am not currently using Migrations but, have you looked here? http://webobjects.mdimension.com/wonder/api/index.html?er/ extensions/partials/package-summary.html

This has an excellent overview of how to setup and use ERMigrations.

I would put the Migration Classes in the same project where your EOModel is, but put the migration properties in the Application's properties file. That way you can control the migration settings on a per-application basis.

As far as the startup goes, I think you have your properties setup incorrectly.

You are naming the model "netbracketsFW":

er.migration.modelNames=netbracketsFW

But you are calling "netbrackets"

netbrackets.MigrationClassPrefix=com.netbrackets.migration.Netbracket s


This should be netbracketsFW.MigrationClassPrefix=...

It doesn't matter where the class is located as long as the class is on the classpath somewhere (framework is on the build path).

I hope this helps!

Dave

On Apr 14, 2009, at 7:33 AM, Jeff Schmitz wrote:

Hello,
I'm trying to get migrations to run on my model that is defined in a framework, but I'm not sure where to put the migrations class (in the framework or my application that references the framework)

In the model framework.

and where to put the properties related to migrations (framework or app?).

I keep these in the framework too, though I see David's point about deciding where you want to control whether the migration happens or not. At the moment my model framework is tightly tied to the Application, so I don't think it really matters in my case. Your case may differ.

Also, what should the first part of the below "netbrackets.MigrationClassPrefix" be named after, the framework project or the app project? I've tried about every different combination I can think of but can't seem to hit on the correct setup as when I run, the database tables don't get created.

Below are how my properties are set:

# Migrations
er.migration.migrateAtStartup=true
er.migration.createTablesIfNecessary=true

er.migration.modelNames=netbracketsFW
This line is not necessary anymore. I am pretty sure that the models in your project are now picked up automatically.

netbrackets.MigrationClassPrefix=com.netbrackets.migration.Netbracket s
This line isn't necessary either.

David


#Connection Dictionary
dbConnectURLGLOBAL=jdbc:frontbase://localhost/myDB
dbConnectUserGLOBAL=myDBUser
dbConnectPasswordGLOBAL=myPW


thanks,
Jeff
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/webobjects% 40avendasora.com

This email sent to [email protected]

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/programmingosx %40mac.com

This email sent to [email protected]

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to