Forum OpenACS Q&A: Re: An fk (from my table to apm_packages) issue maybe?

Collapse
Posted by Dave Bauer on
For a mapping table, that doesn't contain object rows, just use on delete cascade on your foreign key constraints.

If you have a table of objects that has a foreign key to another table of objects, due to historical limitations, you'll need to acs_object__delete the dependant objects first.

For example any objects that have acs_objects.package_id (or context_id) as the package_id you want to delete must be acs_object__deleted before the package is deleted.

You'd have to put that in a before-uninstantiate callback that gets called when a package instance is deleted.

Collapse
Posted by Jim Lynch on
Thanks Dave; that took care of it

-Jim