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

Sponsored-by: Cuyahoga County Public Library <https://cuyahogalibrary.org/>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Matt Blenkinsop 2024-01-22 12:14:02 +00:00 committed by Katrin Fischer
parent 0658dadc90
commit 77569e30fe
Signed by: kfischer
GPG key ID: 0EF6E2C03357A834
2 changed files with 33 additions and 0 deletions

View file

@ -0,0 +1,30 @@
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";
}
},
};

View file

@ -1806,6 +1806,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;