From: Jane Sandberg Date: Sun, 16 May 2021 03:38:08 +0000 (-0700) Subject: LP1881607 stamp upgrade script X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=28cad8db758f0ca802380cb4d43473487996f620;p=evergreen%2Fpines.git LP1881607 stamp upgrade script Signed-off-by: Jane Sandberg --- diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql index 1d0774c8de..9ecead8a6a 100644 --- a/Open-ILS/src/sql/Pg/002.schema.config.sql +++ b/Open-ILS/src/sql/Pg/002.schema.config.sql @@ -92,7 +92,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 ('1260', :eg_version); -- rhamby/serickson/JBoyer +INSERT INTO config.upgrade_log (version, applied_to) VALUES ('1261', :eg_version); -- berick/ehardy/sandbergja CREATE TABLE config.bib_source ( id SERIAL PRIMARY KEY, diff --git a/Open-ILS/src/sql/Pg/upgrade/1261.schema.located-uris-shortcut.sql b/Open-ILS/src/sql/Pg/upgrade/1261.schema.located-uris-shortcut.sql new file mode 100644 index 0000000000..2bde10f299 --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/1261.schema.located-uris-shortcut.sql @@ -0,0 +1,17 @@ +BEGIN; + +SELECT evergreen.upgrade_deps_block_check('1261', :eg_version); + +CREATE OR REPLACE FUNCTION evergreen.located_uris_as_uris + (bibid BIGINT, ouid INT, pref_lib INT DEFAULT NULL) + RETURNS SETOF asset.uri AS $FUNK$ + /* Maps a bib directly to its scoped asset.uri's */ + + SELECT uri.* + FROM evergreen.located_uris($1, $2, $3) located_uri + JOIN asset.uri_call_number_map map ON (map.call_number = located_uri.id) + JOIN asset.uri uri ON (uri.id = map.uri) + +$FUNK$ LANGUAGE SQL STABLE; + +COMMIT; diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.located-uris-shortcut.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.located-uris-shortcut.sql deleted file mode 100644 index a89fa9c402..0000000000 --- a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.located-uris-shortcut.sql +++ /dev/null @@ -1,17 +0,0 @@ -BEGIN; - --- SELECT evergreen.upgrade_deps_block_check('TODO', :eg_version); - -CREATE OR REPLACE FUNCTION evergreen.located_uris_as_uris - (bibid BIGINT, ouid INT, pref_lib INT DEFAULT NULL) - RETURNS SETOF asset.uri AS $FUNK$ - /* Maps a bib directly to its scoped asset.uri's */ - - SELECT uri.* - FROM evergreen.located_uris($1, $2, $3) located_uri - JOIN asset.uri_call_number_map map ON (map.call_number = located_uri.id) - JOIN asset.uri uri ON (uri.id = map.uri) - -$FUNK$ LANGUAGE SQL STABLE; - -COMMIT;