LP1881607 stamp upgrade script
authorJane Sandberg <sandbej@linnbenton.edu>
Sun, 16 May 2021 03:38:08 +0000 (20:38 -0700)
committerJane Sandberg <sandbej@linnbenton.edu>
Sun, 16 May 2021 03:38:08 +0000 (20:38 -0700)
Signed-off-by: Jane Sandberg <sandbej@linnbenton.edu>
Open-ILS/src/sql/Pg/002.schema.config.sql
Open-ILS/src/sql/Pg/upgrade/1261.schema.located-uris-shortcut.sql [new file with mode: 0644]
Open-ILS/src/sql/Pg/upgrade/XXXX.schema.located-uris-shortcut.sql [deleted file]

index 1d0774c..9ecead8 100644 (file)
@@ -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 (file)
index 0000000..2bde10f
--- /dev/null
@@ -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 (file)
index a89fa9c..0000000
+++ /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;