From b09be99317f69234d5fd27a3d7574cafeb6279d5 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Wed, 7 May 2025 14:45:23 +0000 Subject: [PATCH] Bug 39452: (follow-up) Use INSERT IGNORE for system preference --- .../bug_39452_add_cardnumberlog.pl | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 installer/data/mysql/atomicupdate/bug_39452_add_cardnumberlog.pl diff --git a/installer/data/mysql/atomicupdate/bug_39452_add_cardnumberlog.pl b/installer/data/mysql/atomicupdate/bug_39452_add_cardnumberlog.pl new file mode 100755 index 00000000000..6f82ef4ce2e --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_39452_add_cardnumberlog.pl @@ -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'"; + }, +}; -- 2.39.5