Bug 27634: DBRev 23.06.00.020

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Tomas Cohen Arazi 2023-09-19 16:19:45 -03:00
parent 8a833a3510
commit 03f160cba9
No known key found for this signature in database
GPG Key ID: 0A272EA1B2F3C15F
3 changed files with 30 additions and 21 deletions

View File

@ -29,7 +29,7 @@ use vars qw{ $VERSION };
# - #4 : the developer version. The 4th number is the database subversion.
# used by developers when the database changes. updatedatabase take care of the changes itself
# and is automatically called by Auth.pm when needed.
$VERSION = "23.06.00.019";
$VERSION = "23.06.00.020";
sub version {
return $VERSION;

View File

@ -1,20 +0,0 @@
$DBversion = 'XXX'; # will be replaced by the RM
if( CheckVersion( $DBversion ) ) {
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);
}
}
NewVersion( $DBversion, 27634, "Add categorycode and dateexpiry to PatronSelfRegistrationBorrowerUnwantedField");
}

View File

@ -0,0 +1,29 @@
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
);
}
}
},
};