Koha/installer/data/mysql/db_revs/230600057.pl
Tomas Cohen Arazi 7cb3241f06
Bug 26170: DBRev 23.06.00.057
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-11-01 17:23:07 -03:00

31 lines
1.1 KiB
Perl
Executable file

use Modern::Perl;
return {
bug_number => "26170",
description => "Add protected status for patrons",
up => sub {
my ($args) = @_;
my ( $dbh, $out ) = @$args{qw(dbh out)};
if ( !column_exists( 'borrowers', 'protected' ) ) {
$dbh->do(
q{
ALTER TABLE borrowers ADD COLUMN protected tinyint(1) NOT NULL DEFAULT 0
COMMENT 'boolean flag to mark selected patrons as protected from deletion'
AFTER `primary_contact_method`;
}
);
say $out "Added column 'borrowers.protected'";
}
if ( !column_exists( 'deletedborrowers', 'protected' ) ) {
$dbh->do(
q{
ALTER TABLE deletedborrowers ADD COLUMN protected tinyint(1) NOT NULL DEFAULT 0
COMMENT 'boolean flag to mark selected patrons as protected from deletion'
AFTER `primary_contact_method`;
}
);
say $out "Added column 'deletedborrowers.protected'";
}
},
};