From 56df76633042cc4ee085e9c1f9d4d8d2ae9aed03 Mon Sep 17 00:00:00 2001 From: Michele Morgan Date: Mon, 30 Nov 2020 16:19:49 -0500 Subject: [PATCH] LP1905091 Supply environment for added print/email triggers Ensures that OPAC print and email triggers added by upgrade script 1231 (lp 1749475) have appropriate environment. Signed-off-by: Michele Morgan Signed-off-by: Jason Boyer Signed-off-by: Galen Charlton --- ...091.missing_print_email_trigger_environment.sql | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 Open-ILS/src/sql/Pg/upgrade/XXXX.data.lp1905091.missing_print_email_trigger_environment.sql diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.lp1905091.missing_print_email_trigger_environment.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.lp1905091.missing_print_email_trigger_environment.sql new file mode 100644 index 0000000000..a0147932c4 --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.lp1905091.missing_print_email_trigger_environment.sql @@ -0,0 +1,23 @@ +BEGIN; + +SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version); + +INSERT INTO action_trigger.environment (event_def,path) +SELECT id,'items' from action_trigger.event_definition WHERE name='biblio.record_entry.print.full' +AND NOT EXISTS (SELECT 1 FROM action_trigger.environment WHERE +event_def=(SELECT id FROM action_trigger.event_definition WHERE name ='biblio.record_entry.print.full' AND owner=1 LIMIT 1) +AND path='items'); + +INSERT INTO action_trigger.environment (event_def,path) +SELECT id,'items' from action_trigger.event_definition WHERE name='biblio.record_entry.email.full' +AND NOT EXISTS (SELECT 1 FROM action_trigger.environment WHERE +event_def=(SELECT id FROM action_trigger.event_definition WHERE name ='biblio.record_entry.email.full' AND owner=1 LIMIT 1) +AND path='items'); + +INSERT INTO action_trigger.environment (event_def,path) +SELECT id,'owner' from action_trigger.event_definition WHERE name='biblio.record_entry.email.full' +AND NOT EXISTS (SELECT 1 FROM action_trigger.environment WHERE +event_def=(SELECT id FROM action_trigger.event_definition WHERE name ='biblio.record_entry.email.full' AND owner=1 LIMIT 1) +AND path='owner'); + +COMMIT; -- 2.11.0