IForeignKey.DeleteRule does not show SetNull

Please enter any bugs here. We will check this daily!

IForeignKey.DeleteRule does not show SetNull

Postby cminorm on Tue Jan 22, 2008 5:29 pm

My database currently uses NO ACTION, CASCASE, and SET NULL. When I view the results of IForeignKey.Delete rule, it will contain NO ACTION for both NO ACTION and SET NULL. I'm currently using SQL 2005 database and 1.2.0.7 of MyGeneration. I'm also using the latest Entity Spaces, but I don't think that has an impac here.
cminorm
Lurker
 
Posts: 5
Joined: Tue Oct 23, 2007 8:05 pm

Postby dnparsons on Tue Jan 22, 2008 8:21 pm

I can confirm this for MyGeneration 1.3.0.3, as well. If an FK's Delete Rule is set to NO ACTION, or CASCADE, then MyMeta accurately reports that. If an FK's Delete Rule is set to SET NULL, or SET DEFAULT, then MyMeta reports NO ACTION.

BTW, if it is any reassurance, EntitySpaces does not use MyMeta's reported FK rules, it just lets the database do its thing. So, while MyMeta may be inaccurate, it should have no bearing on saving in EntitySpaces. The rules set in the database will prevail.
David Neal Parsons
EntitySpaces
User avatar
dnparsons
Lieutenant General
 
Posts: 292
Joined: Sun Jan 09, 2005 2:10 pm
Location: Miami, Florida

Postby cminorm on Tue Jan 22, 2008 9:13 pm

I've added a presave check in my generated code of entity spaces to ensure that an invalid delete is not attempted. The method is called CanDelete and the form checks this property before attempting a delete. It was either this or disect the error message back from the database into something friendly for the user.
cminorm
Lurker
 
Posts: 5
Joined: Tue Oct 23, 2007 8:05 pm

Postby dnparsons on Wed Jan 23, 2008 3:06 pm

Gotcha. I can see where accurate FK reporting is critical in this case.
David Neal Parsons
EntitySpaces
User avatar
dnparsons
Lieutenant General
 
Posts: 292
Joined: Sun Jan 09, 2005 2:10 pm
Location: Miami, Florida


Return to Defect Reporting (DON'T Post dOOdad bugs HERE)

Who is online

Users browsing this forum: No registered users and 1 guest

cron