Ticket #1573 (new enhancement)

Opened 6 years ago

Last modified 9 months ago

Uninstall module tables in reverse order

Reported by: ajmixto Assigned to: demian
Priority: normal Milestone:
Component: not categorised Severity: open
Keywords: Cc:


I've built a several new modules using pgsql as database with several foreing keys between tables.

I need to create the tables in the correct order so the referenced tables must be created before. So, when I uninstall a module it's needed to delete the tables from database in reverse order to maintain the database integrity.


parche.diff (0.6 kB) - added by ajmixto on 01/14/08 11:14:19.

Change History

01/14/08 11:14:19 changed by ajmixto

  • attachment parche.diff added.

(follow-up: ↓ 2 ) 01/14/08 14:44:17 changed by lakiboy

don't think your patch solves the problem properly. the tables can go in any order. it should be possible to turn of references check in postgres before dropping the tables and enable it back after tables was dropped.

(in reply to: ↑ 1 ) 01/18/08 05:29:23 changed by ajmixto

With pgsql there is no optioin to temporary disable foreign key check (liky MySQL SET FOREIGN_KEY_CHECKS = 0 statement)

So I thought droping tables in reverese order it is an easier way to solve this problem than to drop every foreign key before drop the tables.

01/23/08 07:24:44 changed by demian

  • milestone changed from 0.6.3 to 0.9.0 - polishing.

let's look into this a bit more, agreed with Dmitri that dropping in reverse order sounds like a hack we don't want to commit ourselves to

02/26/13 12:58:14 changed by demian

  • milestone deleted.