Bug 39452: (follow-up) Use INSERT IGNORE for system preference

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Nick Clemens 2025-05-07 14:45:23 +00:00 committed by Katrin Fischer
parent 74a49b117b
commit b7227e8738
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
1 changed files with 21 additions and 0 deletions

View File

@ -0,0 +1,21 @@
use Modern::Perl;
use Koha::Installer::Output qw(say_warning say_success say_info);
return {
bug_number => "39452",
description => "Add CardnumberLog Preference",
up => sub {
my ($args) = @_;
my ( $dbh, $out ) = @$args{qw(dbh out)};
# Do you stuffs here
$dbh->do(
q{
INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES
('CardnumberLog','1',NULL,'If ON, log edit actions on patron cardnumbers','YesNo')
}
);
say $out "Added new system preference 'CardnumberLog'";
},
};