Index: openacs-4/packages/acs-content-repository/sql/postgresql/upgrade/upgrade-5.9.0d1-5.9.0d2.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/sql/postgresql/upgrade/upgrade-5.9.0d1-5.9.0d2.sql,v diff -u -r1.1 -r1.1.2.1 --- openacs-4/packages/acs-content-repository/sql/postgresql/upgrade/upgrade-5.9.0d1-5.9.0d2.sql 2 May 2015 17:23:21 -0000 1.1 +++ openacs-4/packages/acs-content-repository/sql/postgresql/upgrade/upgrade-5.9.0d1-5.9.0d2.sql 21 Aug 2015 09:28:31 -0000 1.1.2.1 @@ -18,10 +18,12 @@ -- -- Handle latest_revision and live_revision via foreign keys --- +-- +ALTER TABLE cr_items DROP CONSTRAINT IF EXISTS cr_items_latest_fk; ALTER TABLE cr_items ADD CONSTRAINT cr_items_latest_fk FOREIGN KEY (latest_revision) REFERENCES cr_revisions(revision_id); +ALTER TABLE cr_items DROP CONSTRAINT IF EXISTS cr_items_live_fk; ALTER TABLE cr_items ADD CONSTRAINT cr_items_live_fk FOREIGN KEY (live_revision) REFERENCES cr_revisions(revision_id);