Forum OpenACS Development: Response to Can't delete unmounted ETP instance
We need to get this cleaned up. You can work on it by simply using the drop script in the sql/postgresql directory directly, that goes a bit quicker than working through the APM.
Luke, Jun ... can one of you dig into this?
Getting drop scripts working correctly is tricky.
aD, in the beginning of ACS 4, chose against widespread use of "on delete cascade" to clean up datamodels, an unfortunate choice IMO. Oracle in 8.1.5 and maybe later (?) didn't/doesn't support "on delete set null" or "on delete set default", also useful in maintaining the integrity of data stored in a datamodel.
Later aD started using "on delete cascade" in more contexts but incompletely.
All this makes getting drop scripts right annoyingly tricky.
As far as whether or not the constraint is redundant or not, I don't know, and am a bit too busy to look into this at the moment.
In general, though, one package shouldn't be changing the datamodel of another package, that's mildly evil. The whole point of having a package abstraction is to have a package abstraction.