Bug 26176: DBRev 23.12.00.061
[koha.git] / installer / data / mysql / db_revs / 231200061.pl
1 use Modern::Perl;
2 use Koha::Installer::Output qw(say_warning say_failure say_success say_info);
3
4 return {
5     bug_number  => "26176",
6     description => "Rename AutoLocation and StaffLoginBranchBasedOnIP system preferences",
7     up          => sub {
8         my ($args) = @_;
9         my ( $dbh, $out ) = @$args{qw(dbh out)};
10
11         $dbh->do(
12             q{
13             UPDATE systempreferences SET variable = "StaffLoginRestrictLibraryByIP"
14             WHERE variable = "AutoLocation"
15         }
16             ) == 1
17             && say_success( $out, "Renamed system preference 'AutoLocation' to 'StaffLoginRestrictLibraryByIP'" );
18
19         $dbh->do(
20             q{
21             UPDATE systempreferences SET variable = "StaffLoginRestrictLibraryByIP"
22             WHERE variable = "StaffLoginLibraryBasedOnIP"
23         }
24             ) == 1
25             && say_success(
26             $out,
27             "Renamed system preference 'StaffLoginLibraryBasedOnIP' to 'StaffLoginRestrictLibraryByIP'"
28             );
29
30     },
31 };