Koha/installer/data/mysql/db_revs/220600004.pl
Tomas Cohen Arazi 7a413f8015
Bug 32191: Tidy upgrade scripts output
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-11-14 15:08:10 -03:00

25 lines
816 B
Perl
Executable file

use Modern::Perl;
return {
bug_number => "12446",
description => "Ability to allow guarantor relationship for all patron category types",
up => sub {
my ($args) = @_;
my ($dbh,$out) = @$args{qw(dbh out)};
unless ( column_exists( 'categories', 'can_be_guarantee' ) ) {
$dbh->do(q{
ALTER TABLE categories
ADD COLUMN `can_be_guarantee` tinyint(1) NOT NULL default 0 COMMENT 'if patrons of this category can be guarantees'
AFTER `checkprevcheckout`
});
say $out "Added column 'categories.can_be_guarantee'";
}
$dbh->do(q{
UPDATE categories
SET can_be_guarantee = 1
WHERE category_type = 'P' OR category_type = 'C'
});
},
};