On Feb 16, 2009, at 8:37 PM, Chuck Hill wrote:

On Feb 14, 2009, at 10:56 AM, Kevin Windham wrote:

I was going through part two of the WO Podcast that David LeBer did, and I noticed a difference in the way his code worked with MySQL and mine worked with FrontBase.

In the second migration there is a bit of code that adds some groups and some users into the DB. In one of the lines the user table is updated to include a foreign key for the relationship to the group table.

table = database.existingTableNamed("t_user");
table.newIntegerColumn("c_group_id", true);

In David's code the allows null for that second line is false, instead of true. I had to change it to true in order for the migration to complete. I think the reason was that FrontBase was enforcing the constraint on the one existing user in the table and since the column is empty on creation it threw an error. Changing that parameter to true allowed the migration to complete.

Did I miss something in following the tutorial, or is this just a difference in how the DBs operate. Is this something that will need to be handled on a case by case basis, and if so how do you account for scenarios where you might need to run an app on multiple DBs, or move from one DB to another?

When the FB database was created, did the FK constraints get marked as DEFERRED INITIALLY DEFERRED? Are you using the FB plugin from Wonder? Are you certain?

The database doesn't appear to have been created that way. It doesn't have any constraints or reference listed on the foreign key. I don't think I specified any plugin. Would this need to be specified in the Model and the Properties file for migrations? Do you always need a plug-in for each DB? I don't recall seeing any for MySQL in the podcast.

Thanks,
Kevin

_______________________________________________
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