开发者

Symfony 1.4: Deleting a sfGuardUser

I'm having some trouble with the following...

I have a sfGuardUser table set up normally, and it has a one-to-one relationship with a Profile table, which contains some additional user info.

When a user开发者_Python百科 wants to delete themselves from the site, I'd like to retain their info in the Profile table for various purposes BUT delete the sfGuardUser in order to keep that table cleaner/shorter (not just set it to inactive).

I was under the impression that I could set the FK in the Profile table to NULL and then delete the sfGuardUser, but it seems the FK-constraint fails.

Other than leaving outdated sfGuardUsers and Profiles in both of these tables, or having to use a cascaded delete to get rid of both, can anyone tell me if there's any other way around this?

Thank you.


Found it.

Doctrine allows onDelete: SET NULL.

Hope that helps someone.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜