Mailing List Archive

Missing database relationship between group_member and principal?
On Thu, 2010-06-24 at 10:01 +0200, Matthias Mohr wrote:
> Hi everybody,
>
> we're currently testing an update of our DAViCal server from 0.9.7.6 to
> offical 0.9.9
> But I think there might be missing database relationship between the table
> principal and group_member.
>
> Why do we think so?
> Because if you delete a group (via the web interface) it does delete
> the group from the DB table "principal" but the group members to the no
> longer available group still remain in table "group_member".
>
> So I added the following foreign keys:
> ---------------------------------------------------------------------------
> ALTER TABLE group_member
> ADD CONSTRAINT fk_principal_group FOREIGN KEY (group_id)
> REFERENCES principal (principal_id) MATCH SIMPLE
> ON UPDATE CASCADE ON DELETE CASCADE;
> ALTER TABLE group_member
> ADD CONSTRAINT fk_principal_member FOREIGN KEY (member_id)
> REFERENCES principal (principal_id) MATCH SIMPLE
> ON UPDATE CASCADE ON DELETE CASCADE;
> ---------------------------------------------------------------------------
>
> After doing that, deleting a group includes deleting its members - good ;-)
>
> So I assume this is a bug?!

Something like this seems reasonable, so I'll add it to my next database
patch - thanks :-)

Cheers,
Andrew.


--
------------------------------------------------------------------------
andrew (AT) morphoss (DOT) com +64(272)DEBIAN
You will be misunderstood by everyone.
------------------------------------------------------------------------

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.morphoss.com/pipermail/davical-users/attachments/20100624/3d3a40a8/attachment.pgp>
-------------- next part --------------