Forum OpenACS Development: Re: Clean delete of packages

Collapse
Posted by Tilmann Singer on
Peter,

<blockquote> why don't we delete them in acs_object__delete?
</blockquote>

That's exactly what's happening now. The reason not to use cascade in this case was just that it was simpler because it doesn't require complicated upgrade scripts, just reloading the pl/sql (plpgsql) code.

The reason not to use cascade in many other cases is one most strongly made by Dirk (on irc, maybe also somewhere in this forum), that deletion of data in general is a bad idea, and there is no need to jump trough loops to enable it everywhere in the toolkit. The foreign key constraints are thus a good thing, because they prevent you from deleting data that is referenced from somewhere else. A good example for this is the user object - you almost certainly wouldn't want a system that deletes on cascade all objects a user has references to, directly because he created them or somehow indirectly. We might just have to accept that in a highly referenced data like in OpenACS things like users are just not deletable.