Bug 36986: (QA follow-up) Catch the case where someone already upgraded

This adds a corresponding atomic update for the case where someone may
have already upgraded past the version we're correcting in the prior
patch.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit d0f1298951)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
Martin Renvoize 2024-06-04 11:15:59 +01:00 committed by Fridolin Somers
parent 09304fe33f
commit 4dd3df5e1a
1 changed files with 23 additions and 0 deletions

View File

@ -0,0 +1,23 @@
use Modern::Perl;
use Koha::Installer::Output qw(say_warning say_failure say_success say_info);
return {
bug_number => "36986",
description => "Rename StaffLoginLibraryBasedOnIP system preference",
up => sub {
my ($args) = @_;
my ( $dbh, $out ) = @$args{qw(dbh out)};
$dbh->do(
q{
UPDATE systempreferences SET variable = "StaffLoginLibraryBasedOnIP"
WHERE variable = "StaffLoginBranchBasedOnIP"
}
) == 1
&& say_success(
$out,
"Renamed system preference 'StaffLoginBranchBasedOnIP' to 'StaffLoginLibraryBasedOnIP'"
);
},
};