From: Mike Rylander Date: Wed, 27 Mar 2013 19:50:40 +0000 (-0400) Subject: Stamping upgrade script for aoupa constraint fix X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=9f831d2a1120e2336aa66f1ea77405632907b49e;p=contrib%2FConifer.git Stamping upgrade script for aoupa constraint fix Signed-off-by: Mike Rylander --- diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql index 8d86600d4a..07bb2354ef 100644 --- a/Open-ILS/src/sql/Pg/002.schema.config.sql +++ b/Open-ILS/src/sql/Pg/002.schema.config.sql @@ -91,7 +91,7 @@ CREATE TRIGGER no_overlapping_deps BEFORE INSERT OR UPDATE ON config.db_patch_dependencies FOR EACH ROW EXECUTE PROCEDURE evergreen.array_overlap_check ('deprecates'); -INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0784', :eg_version); -- Callender/berick +INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0785', :eg_version); -- senator/miker CREATE TABLE config.bib_source ( id SERIAL PRIMARY KEY, diff --git a/Open-ILS/src/sql/Pg/upgrade/0785.schema.aoupa-unique-constraint.sql b/Open-ILS/src/sql/Pg/upgrade/0785.schema.aoupa-unique-constraint.sql new file mode 100644 index 0000000000..37b15b8c81 --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/0785.schema.aoupa-unique-constraint.sql @@ -0,0 +1,17 @@ +BEGIN; + +SELECT evergreen.upgrade_deps_block_check('0785', :eg_version); + +DROP INDEX actor.prox_adj_once_idx; + +CREATE UNIQUE INDEX prox_adj_once_idx ON actor.org_unit_proximity_adjustment ( + COALESCE(item_circ_lib, -1), + COALESCE(item_owning_lib, -1), + COALESCE(copy_location, -1), + COALESCE(hold_pickup_lib, -1), + COALESCE(hold_request_lib, -1), + COALESCE(circ_mod, ''), + pos +); + +COMMIT; diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.aoupa-unique-constraint.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.aoupa-unique-constraint.sql deleted file mode 100644 index 1f5221d2ca..0000000000 --- a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.aoupa-unique-constraint.sql +++ /dev/null @@ -1,17 +0,0 @@ -BEGIN; - -SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version); - -DROP INDEX actor.prox_adj_once_idx; - -CREATE UNIQUE INDEX prox_adj_once_idx ON actor.org_unit_proximity_adjustment ( - COALESCE(item_circ_lib, -1), - COALESCE(item_owning_lib, -1), - COALESCE(copy_location, -1), - COALESCE(hold_pickup_lib, -1), - COALESCE(hold_request_lib, -1), - COALESCE(circ_mod, ''), - pos -); - -COMMIT;