I would turn on debugging for the er.extensions.migration.ERXMigrator
log4j logger and see what it says ...
ms
On Apr 14, 2009, at 10:34 PM, Jeff Schmitz wrote:
On Apr 14, 2009, at 8: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
Hmm, I don't really see much about the mechanics of setting up
migrations at that link.
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.Netbrackets
This should be netbracketsFW.MigrationClassPrefix=...
I think I've set it up as you recommended but the migration class
still doesn't get called. In my latest try I have put everything
(EOModel, migrations class and properties) in the framework project.
# Migrations
er.migration.migrateAtStartup=true
er.migration.createTablesIfNecessary=true
er.migration.modelNames=netbracketsFW
netbracketsFW
.MigrationClassPrefix=com.netbracketsfw.migrations.NetbracketsFW
#Connection Dictionary
dbConnectURLGLOBAL=jdbc:frontbase://localhost/myDB
dbConnectUserGLOBAL=myDBUser
dbConnectPasswordGLOBAL=myPassword
----------<NetbracketsFW0.java file>---------------
package com.netbracketsfw.migrations;
import com.webobjects.eocontrol.EOEditingContext;
import com.webobjects.foundation.NSArray;
import er.extensions.migration.ERXMigrationDatabase;
import er.extensions.migration.ERXMigrationTable;
import er.extensions.migration.ERXModelVersion;
public class NetbracketsFW0 extends ERXMigrationDatabase.Migration {
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)
and where to put the properties related to migrations (framework
or app?). 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
netbrackets
.MigrationClassPrefix=com.netbrackets.migration.Netbrackets
#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/mschrag%40mdimension.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]