Well spotted. Seems to me it should be removing the relevant
reply_to links in the notice table before deleting the notice
itself.

(i.e. it should have done "update notice set reply_to=null where
reply_to=44" before it attempted that delete)

I never cease to me amazed by what MySQL lets you get away with.

Cheers,

Ciaran

Brenda Wallace wrote:
> can't delete a notice if it has been replied to.
> 
> 2009-03-11 11:56:38 NZDT ERROR:  update or delete on table "notice"
> violates foreign key constraint "notice_reply_to_fkey" on table
> "notice"
> 2009-03-11 11:56:38 NZDT DETAIL:  Key (id)=(44) is still referenced
> from table "notice".
> 2009-03-11 11:56:38 NZDT STATEMENT:  DELETE FROM "notice"  WHERE (
> "notice"."id" = 44 )
> 
> What's the way forward here? remove the foreign key? or instead
> deleting we make that notice with SET deleted=true.
> .. Some other method?
> 


_______________________________________________
Laconica-dev mailing list
[email protected]
http://mail.laconi.ca/mailman/listinfo/laconica-dev

Reply via email to