From: Michele Morgan Date: Mon, 30 Nov 2020 21:19:49 +0000 (-0500) Subject: LP1905091 Supply environment for added print/email triggers X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=56df76633042cc4ee085e9c1f9d4d8d2ae9aed03;p=evergreen%2Ftadl.git 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 --- 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;