From: miker Date: Thu, 16 Sep 2010 14:39:46 +0000 (+0000) Subject: This needs to be the same in 2.0 as trunk, and the changes to this script need to... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=d40ccc4ee5629f1ae9eb0cccd16e14eadd9d34d2;p=evergreen%2Fjoelewis.git This needs to be the same in 2.0 as trunk, and the changes to this script need to make it into the 1.6-2.0 upgrade script as well, if not there already git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_2_0@17731 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/sql/Pg/upgrade/0387.schema.perm_list_fkeys_restrict_delete.sql b/Open-ILS/src/sql/Pg/upgrade/0387.schema.perm_list_fkeys_restrict_delete.sql index c79e37515a..9b3c72189f 100644 --- a/Open-ILS/src/sql/Pg/upgrade/0387.schema.perm_list_fkeys_restrict_delete.sql +++ b/Open-ILS/src/sql/Pg/upgrade/0387.schema.perm_list_fkeys_restrict_delete.sql @@ -1,18 +1,22 @@ + +-- First drop the stuff we are going to (re)create. If it fails for not existing, fine. + +ALTER TABLE permission.grp_perm_map DROP CONSTRAINT grp_perm_map_perm_fkey; +ALTER TABLE permission.usr_perm_map DROP CONSTRAINT usr_perm_map_perm_fkey; +ALTER TABLE permission.usr_object_perm_map DROP CONSTRAINT usr_object_perm_map_perm_fkey; +ALTER TABLE config.org_unit_setting_type DROP CONSTRAINT view_perm_fkey; + BEGIN; INSERT INTO config.upgrade_log (version) VALUES ('0387'); --gmc -ALTER TABLE permission.grp_perm_map DROP CONSTRAINT grp_perm_map_perm_fkey; ALTER TABLE permission.grp_perm_map ADD CONSTRAINT grp_perm_map_perm_fkey FOREIGN KEY (perm) REFERENCES permission.perm_list (id) ON UPDATE CASCADE ON DELETE RESTRICT DEFERRABLE INITIALLY DEFERRED; -ALTER TABLE permission.usr_perm_map DROP CONSTRAINT usr_perm_map_perm_fkey; ALTER TABLE permission.usr_perm_map ADD CONSTRAINT usr_perm_map_perm_fkey FOREIGN KEY (perm) REFERENCES permission.perm_list (id) ON UPDATE CASCADE ON DELETE RESTRICT DEFERRABLE INITIALLY DEFERRED; -ALTER TABLE permission.usr_object_perm_map DROP CONSTRAINT usr_object_perm_map_perm_fkey; ALTER TABLE permission.usr_object_perm_map ADD CONSTRAINT usr_object_perm_map_perm_fkey FOREIGN KEY (perm) REFERENCES permission.perm_list (id) ON UPDATE CASCADE ON DELETE RESTRICT DEFERRABLE INITIALLY DEFERRED; -ALTER TABLE config.org_unit_setting_type DROP CONSTRAINT view_perm_fkey; ALTER TABLE config.org_unit_setting_type ADD CONSTRAINT view_perm_fkey FOREIGN KEY (view_perm) REFERENCES permission.perm_list (id) ON UPDATE CASCADE ON DELETE RESTRICT DEFERRABLE INITIALLY DEFERRED; COMMIT;