From b4cac4f3f771438d42180f20ff572025009f5268 Mon Sep 17 00:00:00 2001 From: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> Date: Mon, 22 Jan 2024 12:14:02 +0000 Subject: [PATCH] Bug 28924: Add 3 new columns to categories table This patch adds three new columns to the patron categories table: noissuescharge noissueschargegurantees noissueschargeguarantorswithguarantees These values will allow charge limits to be set at category level rather than globally for all patrons. If the values are not set at category level then the system will use the global level values Signed-off-by: David Nind <david@davidnind.com> --- .../atomicupdate/bug_28924-noissuescharges.pl | 26 +++++++++++++++++++ installer/data/mysql/kohastructure.sql | 3 +++ 2 files changed, 29 insertions(+) create mode 100644 installer/data/mysql/atomicupdate/bug_28924-noissuescharges.pl diff --git a/installer/data/mysql/atomicupdate/bug_28924-noissuescharges.pl b/installer/data/mysql/atomicupdate/bug_28924-noissuescharges.pl new file mode 100644 index 0000000000..b10366e2d0 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_28924-noissuescharges.pl @@ -0,0 +1,26 @@ +use Modern::Perl; + +return { + bug_number => "28924", + description => "Adds columns to patron categories to allow category level values for the no issue charge sysprefs", + up => sub { + my ($args) = @_; + my ( $dbh, $out ) = @$args{qw(dbh out)}; + + unless ( column_exists( 'categories', 'noissuescharge' ) ) { + $dbh->do(q{ ALTER TABLE categories ADD COLUMN `noissuescharge` int(11) AFTER `exclude_from_local_holds_priority` }); + + say $out "Added column 'noissuescharge' to categories"; + } + unless ( column_exists( 'categories', 'noissueschargeguarantees' ) ) { + $dbh->do(q{ ALTER TABLE categories ADD COLUMN `noissueschargeguarantees` int(11) AFTER `noissuescharge` }); + + say $out "Added column 'noissueschargeguarantees' to categories"; + } + unless ( column_exists( 'categories', 'noissueschargeguarantorswithguarantees' ) ) { + $dbh->do(q{ ALTER TABLE categories ADD COLUMN `noissueschargeguarantorswithguarantees` int(11) AFTER `noissueschargeguarantees` }); + + say $out "Added column 'noissueschargeguarantorswithguarantees' to categories"; + } + }, +}; diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 54f739f6c9..dc6eac6afb 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -1817,6 +1817,9 @@ CREATE TABLE `categories` ( `min_password_length` smallint(6) DEFAULT NULL COMMENT 'set minimum password length for patrons in this category', `require_strong_password` tinyint(1) DEFAULT NULL COMMENT 'set required password strength for patrons in this category', `exclude_from_local_holds_priority` tinyint(1) DEFAULT NULL COMMENT 'Exclude patrons of this category from local holds priority', + `noissuescharge` int(11) DEFAULT NULL COMMENT 'define maximum amount withstanding before checkouts are blocked', + `noissueschargeguarantees` int(11) DEFAULT NULL COMMENT 'define maximum amount withstanding before checkouts are blocked', + `noissueschargeguarantorswithguarantees` int(11) DEFAULT NULL COMMENT 'define maximum amount withstanding before checkouts are blocked', PRIMARY KEY (`categorycode`), UNIQUE KEY `categorycode` (`categorycode`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- 2.39.2