before the line where you delete the user. Probably you have to save the partner after unlinking and before deleting the user.
On Mar 19, 2010, at 10:12 , saki wrote: > thank you! where can I put the unlink row? > > On Mar 18, 7:35 pm, Lea Hänsenberger <[email protected]> wrote: >> hi, >> there's still a partner with a foreign key pointing to the user you want to >> delete. you should first unlink the user from the partner: >> $partner->unlink('rmUser',$user_id); >> >> Then you should be able to delete the user object. >> >> cheers, >> Lea >> >> On Mar 18, 2010, at 13:19 , saki wrote: >> >>> hi guys! >> >>> Please help me to solve my little problem. I have two tables. Users >>> and Partners... in the schema.yml file you can see the relation.. >> >>> rmPartner: >>> ... >>> relations: >>> rmUser: { onDelete: CASCADE, local: contact, foreign: id } >> >>> Unfortunately, when I delete a User, symfony deletes his Partner(s), >>> too. I think onDelete: CASCADE cause this. A removed and run: symfony >>> doctrine:build --all ... now, when i want to delete a user, a get: >> >>> 500 | Internal Server Error | Doctrine_Connection_Mysql_Exception >>> SQLSTATE[HY000]: General error: 1451 Cannot delete or update a parent >>> row: a foreign key constraint fails (`rm`.`rm_partner`, CONSTRAINT >>> `rm_partner_contact_rm_user_id` FOREIGN KEY (`contact`) REFERENCES >>> `rm_user` (`id`)) >> >>> How can I solve this? What should I do, when i dont want to delete the >>> related rows? >> >>> Thank you in advance! >> >>> -- >>> If you want to report a vulnerability issue on symfony, please send it to >>> security at symfony-project.com >> >>> You received this message because you are subscribed to the Google >>> Groups "symfony users" group. >>> To post to this group, send email to [email protected] >>> To unsubscribe from this group, send email to >>> [email protected] >>> For more options, visit this group at >>> http://groups.google.com/group/symfony-users?hl=en > > -- > If you want to report a vulnerability issue on symfony, please send it to > security at symfony-project.com > > You received this message because you are subscribed to the Google > Groups "symfony users" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/symfony-users?hl=en > > To unsubscribe from this group, send email to > symfony-users+unsubscribegooglegroups.com or reply to this email with the > words "REMOVE ME" as the subject. -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en To unsubscribe from this group, send email to symfony-users+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.
