Koha/installer/data/mysql/db_revs/230600047.pl
Tomas Cohen Arazi 57cc290bb8
Bug 15504: DBRev 23.06.00.047
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-24 10:05:24 -03:00

33 lines
1.2 KiB
Perl
Executable file

use Modern::Perl;
return {
bug_number => "15504",
description => "Adds a new system preference - TrackLastPatronActivityTriggers",
up => sub {
my ($args) = @_;
my ( $dbh, $out ) = @$args{qw(dbh out)};
# Get existing value from the TrackLastPatronActivity system preference
my ($tracklastactivity) = $dbh->selectrow_array(
q{
SELECT value FROM systempreferences WHERE variable='TrackLastPatronActivity';
}
);
my $triggers = $tracklastactivity ? 'check_out,connection,login' : '';
$dbh->do(
qq{INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('TrackLastPatronActivityTriggers',?,NULL,'If set, the field borrowers.lastseen will be updated every time a patron performs a selected action','multiple') },
undef, $triggers,
);
say $out "Added system preference 'TrackLastPatronActivityTriggers'";
$dbh->do(
q{
DELETE FROM systempreferences WHERE variable='TrackLastPatronActivity'
}
);
say $out "Removed system preference 'TrackLastPatronActivity'";
},
};