Forum OpenACS Development: Re: ]project-open[ new Filestorage - acs_object__delete throws acs_permissions_on_what_id_fk

Dear Frank, I cannot comment about Project Open, but the "vanilla" OpenACS already defines the ON DELETE CASCADE behavior you suggest (sorry for the italian shell):
oacs-5-10=# \d acs_permissions
          Tabella "public.acs_permissions"
  Colonna   |          Tipo          | Modificatori 
------------+------------------------+--------------
 object_id  | integer                | non null
 grantee_id | integer                | non null
 privilege  | character varying(100) | non null
Indici:
    "acs_permissions_pk" PRIMARY KEY, btree (object_id, grantee_id, privilege)
    "acs_permissions_grantee_idx" btree (grantee_id)
    "acs_permissions_object_id_idx" btree (object_id)
    "acs_permissions_privilege_idx" btree (privilege)
Vincoli di integrità referenziale
    "acs_permissions_grantee_id_fk" FOREIGN KEY (grantee_id) REFERENCES parties(party_id) ON DELETE CASCADE
    "acs_permissions_object_id_fk" FOREIGN KEY (object_id) REFERENCES acs_objects(object_id) ON DELETE CASCADE
    "acs_permissions_privilege_fk" FOREIGN KEY (privilege) REFERENCES acs_privileges(privilege) ON DELETE CASCADE
Furthermore, "acs_permissions_on_what_id_fk" constraint does not exist in a default installation.

All the best
Thanks a lot!

Interesting, maybe this is because of an upgrade issue from an older version of OpenACS? I'll check, but this already helped a lot.

Cheers
Frank

Using "on delete cascade" on the permissions table is not a recent change, but was introduced to OpenACS 14 years ago (2005, [1]).

-gn

[1] https://github.com/openacs/openacs-core/blame/2153b958443b2b1f296fa5bf434c338146a38e8f/packages/acs-kernel/sql/postgresql/acs-permissions-create.sql#L404

The current ]po[ default database has been created in 2004 😊, I believe and since upgraded to the respective OpenACS and ]po[ version.

Frank

If you upgrade acs-core to 5.9.1, these constraints are added.