From c2ae16ac876cc275a5a6c9e7a5e556370b134e9a Mon Sep 17 00:00:00 2001 From: Aleisha Amohia Date: Sun, 30 Apr 2023 22:20:23 +0000 Subject: [PATCH] Bug 8367: Add holds_pickup_period fallback circulation rule Signed-off-by: Katrin Fischer Signed-off-by: Kelly Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi --- ...ug_8367-add_holds_pickup_period_circrule.pl | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 installer/data/mysql/atomicupdate/bug_8367-add_holds_pickup_period_circrule.pl diff --git a/installer/data/mysql/atomicupdate/bug_8367-add_holds_pickup_period_circrule.pl b/installer/data/mysql/atomicupdate/bug_8367-add_holds_pickup_period_circrule.pl new file mode 100644 index 0000000000..efa20249b7 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_8367-add_holds_pickup_period_circrule.pl @@ -0,0 +1,18 @@ +use Modern::Perl; + +return { + bug_number => "8367", + description => "Set hold pickup period circulation rule", + up => sub { + my ($args) = @_; + my ($dbh, $out) = @$args{qw(dbh out)}; + + $dbh->do(q{ + INSERT IGNORE INTO circulation_rules ( branchcode, categorycode, itemtype, rule_name, rule_value ) + SELECT u.* FROM (SELECT NULL as branchcode, NULL as categorycode, NULL as itemtype, 'holds_pickup_period' as rule_name, '' as rule_value) u + WHERE NOT EXISTS ( SELECT rule_name FROM circulation_rules where rule_name = 'holds_pickup_period' ) + }); + + say $out "Added default circulation rule for holds_pickup_period"; + }, +}; -- 2.39.5