Koha/installer/data/mysql/db_revs/230600020.pl
Tomas Cohen Arazi 03f160cba9
Bug 27634: DBRev 23.06.00.020
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-09-19 16:34:22 -03:00

29 lines
934 B
Perl
Executable file

use Modern::Perl;
return {
bug_number => "27634",
description => "Add categorycode and dateexpiry to PatronSelfRegistrationBorrowerUnwantedField",
up => sub {
my ($args) = @_;
my ( $dbh, $out ) = @$args{qw(dbh out)};
for my $f (qw( categorycode dateexpiry )) {
my ($exists) = $dbh->selectrow_array(
qq{
SELECT value from systempreferences
WHERE variable="PatronSelfRegistrationBorrowerUnwantedField"
AND value LIKE "%$f%"
}
);
unless ($exists) {
$dbh->do(
q{
UPDATE systempreferences
SET value = CONCAT(value, IF(value<>'','|',''), ?)
WHERE variable="PatronSelfRegistrationBorrowerUnwantedField"
}, undef, $f
);
}
}
},
};