[open-ils-commits] [GIT] Evergreen ILS branch rel_3_5 updated. 09e7d384b0523be53c64e736889c141fd94108d0
Evergreen Git
git at git.evergreen-ils.org
Fri Jul 17 07:15:07 EDT 2020
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".
The branch, rel_3_5 has been updated
via 09e7d384b0523be53c64e736889c141fd94108d0 (commit)
via bca8f5ec8040291b2b39a7e7ca31f223c51fb3f3 (commit)
from ee2d830686d02a37b8b26841ddd496fe1bfbe0c0 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 09e7d384b0523be53c64e736889c141fd94108d0
Author: Jason Stephenson <jason at sigio.com>
Date: Fri Jul 17 07:09:29 2020 -0400
LP#1886852: Stamping Upgrade Script
Signed-off-by: Jason Stephenson <jason at sigio.com>
diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql
index a7c976a3eb..f5b836e83b 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 ('1204', :eg_version); -- jeffdavis/sandbergja/csharp
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('1206', :eg_version); -- miker/dyrcona
CREATE TABLE config.bib_source (
id SERIAL PRIMARY KEY,
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.function.distinct-regen_copy_map.sql b/Open-ILS/src/sql/Pg/upgrade/1206.function.distinct-regen_copy_map.sql
similarity index 82%
rename from Open-ILS/src/sql/Pg/upgrade/XXXX.function.distinct-regen_copy_map.sql
rename to Open-ILS/src/sql/Pg/upgrade/1206.function.distinct-regen_copy_map.sql
index 2d4739a48e..a1ecf1b55c 100755
--- a/Open-ILS/src/sql/Pg/upgrade/XXXX.function.distinct-regen_copy_map.sql
+++ b/Open-ILS/src/sql/Pg/upgrade/1206.function.distinct-regen_copy_map.sql
@@ -1,6 +1,6 @@
BEGIN;
-SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+SELECT evergreen.upgrade_deps_block_check('1206', :eg_version);
CREATE OR REPLACE FUNCTION
action.hold_request_regen_copy_maps(
commit bca8f5ec8040291b2b39a7e7ca31f223c51fb3f3
Author: Mike Rylander <mrylander at gmail.com>
Date: Wed Jul 8 13:18:52 2020 -0400
LP#1886852: Protect against dupes in hold-copy map function
If the DB function that regenerates the hold-copy maps for a hold
receives duplicate copies in its second parameter, it blows up. This
commit prevents that by making the list unique at use time.
Signed-off-by: Mike Rylander <mrylander at gmail.com>
Signed-off-by: Jason Stephenson <jason at sigio.com>
diff --git a/Open-ILS/src/sql/Pg/090.schema.action.sql b/Open-ILS/src/sql/Pg/090.schema.action.sql
index af8a3e36b9..8d8163b6f9 100644
--- a/Open-ILS/src/sql/Pg/090.schema.action.sql
+++ b/Open-ILS/src/sql/Pg/090.schema.action.sql
@@ -548,7 +548,7 @@ CREATE OR REPLACE FUNCTION
action.hold_request_regen_copy_maps(
hold_id INTEGER, copy_ids INTEGER[]) RETURNS VOID AS $$
DELETE FROM action.hold_copy_map WHERE hold = $1;
- INSERT INTO action.hold_copy_map (hold, target_copy) SELECT $1, UNNEST($2);
+ INSERT INTO action.hold_copy_map (hold, target_copy) SELECT DISTINCT $1, UNNEST($2);
$$ LANGUAGE SQL;
CREATE TABLE action.transit_copy (
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.function.distinct-regen_copy_map.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.function.distinct-regen_copy_map.sql
new file mode 100755
index 0000000000..2d4739a48e
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.function.distinct-regen_copy_map.sql
@@ -0,0 +1,12 @@
+BEGIN;
+
+SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+
+CREATE OR REPLACE FUNCTION
+ action.hold_request_regen_copy_maps(
+ hold_id INTEGER, copy_ids INTEGER[]) RETURNS VOID AS $$
+ DELETE FROM action.hold_copy_map WHERE hold = $1;
+ INSERT INTO action.hold_copy_map (hold, target_copy) SELECT DISTINCT $1, UNNEST($2);
+$$ LANGUAGE SQL;
+
+COMMIT;
-----------------------------------------------------------------------
Summary of changes:
Open-ILS/src/sql/Pg/002.schema.config.sql | 2 +-
Open-ILS/src/sql/Pg/090.schema.action.sql | 2 +-
.../sql/Pg/upgrade/1206.function.distinct-regen_copy_map.sql | 12 ++++++++++++
3 files changed, 14 insertions(+), 2 deletions(-)
create mode 100755 Open-ILS/src/sql/Pg/upgrade/1206.function.distinct-regen_copy_map.sql
hooks/post-receive
--
Evergreen ILS
More information about the open-ils-commits
mailing list