Forum OpenACS Development: 'content_revision__del' not removing acs_permissions

Hi all,

just noticed that the latest version of 'content_revision__del' deployed w/ upgrade-5.9.0d2-5.9.0d3.sql does not remove permissions.

Earlier versions did, e.g. upgrade-5.1.4d4-5.1.4d5.sql:


raise NOTICE ''Deleting associated permissions...'';
-- 5) delete associated permissions
delete from acs_permissions
where object_id = delete__item_id;

However, I do not want to exclude the possibility that the error I ran into is somehow specific to ]project-open[ ...

Cheers
Klaus

The manual deletion is not necessary since there is a "on delete cascade" on acs_permissions, introduced between 5.2.0d7 and 5.2.0d8. Can it be that ProjectOpen missed this? Or is there another problem?

-g
[1] https://github.com/openacs/openacs-core/commit/4a5c57b90423b37848e4bb22e4f83c0cfa33f925#diff-f738f95a230b32cc2af472d6612f37a5L137

Thanks Gustav,

the 'delete cascade' constraint of the acs_permissions table is indeed missing.
Among other techniques I used FishEye [1] to find the related update script for the change you referred me to, but I wasn't able to find it.

Cheers
Klaus

[1] http://cvs.openacs.org/search/OpenACS/?comment=&contents=&addedText=&deletedText=&filename=*upgrade-*&branch=oacs-5-9&tag=&fromdate=2005-02-25T00%3A00%3A00&todate=2005-03-01T00%3A00%3A00&datesortorder=DESCENDING&groupby=changeset&col=path&col=revision&col=author&col=date&col=csid&refresh=y

At the time, the "on delete cascade" was added to acs_permissions, as it looks to me, don did not provide an upgrade script. There was as well a non-conforming naming of of the constraints "...on_what_id" vs. "...object_id", which was consolidated by [1] also for old installations.

-gn

[1] http://cvs.openacs.org/changelog/OpenACS?cs=oacs-5-9%3Agustafn%3A20151231140020

Thanks so much for the clarification and for takin' the time looking into this.