-- Dropping a foreign key (which has already been dropped from the
authorscottmk <scottmk@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 17 Sep 2010 14:17:44 +0000 (14:17 +0000)
committerscottmk <scottmk@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 17 Sep 2010 14:17:44 +0000 (14:17 +0000)
-- base installation scripts).

M    Open-ILS/src/sql/Pg/002.schema.config.sql
M    Open-ILS/src/sql/Pg/1.6.1-2.0-upgrade-db.sql
A    Open-ILS/src/sql/Pg/upgrade/0405.schema.acq-hold-copy-map-drop-fkey.sql

git-svn-id: svn://svn.open-ils.org/ILS/trunk@17762 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/sql/Pg/002.schema.config.sql
Open-ILS/src/sql/Pg/1.6.1-2.0-upgrade-db.sql
Open-ILS/src/sql/Pg/upgrade/0405.schema.acq-hold-copy-map-drop-fkey.sql [new file with mode: 0644]

index 41f379e..d3cafe3 100644 (file)
@@ -68,7 +68,7 @@ CREATE TABLE config.upgrade_log (
     install_date    TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
 );
 
-INSERT INTO config.upgrade_log (version) VALUES ('0403'); -- dbwells via miker
+INSERT INTO config.upgrade_log (version) VALUES ('0405'); -- Scott McKellar
 
 CREATE TABLE config.bib_source (
        id              SERIAL  PRIMARY KEY,
index 0b3fc2e..83a2c63 100644 (file)
@@ -3,7 +3,7 @@ BEGIN;
 -- Highest-numbered individual upgrade script
 -- incorporated herein:
 
-INSERT INTO config.upgrade_log (version) VALUES ('0403');
+INSERT INTO config.upgrade_log (version) VALUES ('0405');
 
 -- Begin by upgrading permission.perm_list.  This is fairly complicated.
 
@@ -16146,6 +16146,7 @@ $$ LANGUAGE SQL;
 ALTER TABLE action.in_house_use DROP CONSTRAINT in_house_use_item_fkey;
 ALTER TABLE action.transit_copy DROP CONSTRAINT transit_copy_target_copy_fkey;
 ALTER TABLE action.hold_transit_copy DROP CONSTRAINT ahtc_tc_fkey;
+ALTER TABLE action.hold_copy_map DROP CONSTRAINT hold_copy_map_target_copy_fkey;
 
 ALTER TABLE asset.stat_cat_entry_copy_map DROP CONSTRAINT a_sc_oc_fkey;
 
diff --git a/Open-ILS/src/sql/Pg/upgrade/0405.schema.acq-hold-copy-map-drop-fkey.sql b/Open-ILS/src/sql/Pg/upgrade/0405.schema.acq-hold-copy-map-drop-fkey.sql
new file mode 100644 (file)
index 0000000..7d61e29
--- /dev/null
@@ -0,0 +1,12 @@
+-- Drop a foreign key.  It is commented out in 090.schema.action.sql
+-- but was never dropped via an upgrade script.
+
+-- No transaction, in case the fkey has already been dropped by
+-- other means.
+
+INSERT INTO config.upgrade_log (version) VALUES ('0405'); -- Scott McKellar
+
+\qecho If the following ALTER TABLE fails because the constraint
+\qecho being dropped doesn't exist, that's okay.  Ignore the failure.
+
+ALTER TABLE action.hold_copy_map DROP CONSTRAINT hold_copy_map_target_copy_fkey;