Forum OpenACS Development: Re: Attribute "tag" in party_approved_member_map

Collapse
Posted by Gustaf Neumann on
Actually, Guenter Ernst figured out, why the "tag" attribute is needed. The reasons are composite rels in openacs. It is possible, that there are redundant reasons for being an (approved) member, and when only one of these redundant entries is deleted, the other one has to stay (the "tag" disambiguates the entries). The Oracle variant does this via refcounting, i have no idea, why postgres does it differently.

However, the following should be done to reduce the guesswork:
a) rename "tag" into "originating_rel_id"
b) replace the "0" of the sellf-membership by a NULL
c) define a fk for "originating_rel_id" to acs_rels.

Collapse
Posted by Gustaf Neumann on
The details of the change were a little more involved: A NULL value was not possible, since the field is part of the primary key (which is always not NULL). Therefore, it was necessary to introduce an "identity_rel" (magic value -10) which serves as a special value, and it allows to use a fk to acs_rels.

These changes are now committed to the oacs-5-9 branch.

The Oracle version us quite different, it uses a ref-count instead of the "originating_rel_id", where the latter makes it easier to understand the whereabouts of the values and eases deletions, etc.