From f840f7c92502d3c812e11baccdf841f643d228d7 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 22 Sep 2023 08:30:35 +0200 Subject: [PATCH] Bug 34720: Say if syspref has been inserted Signed-off-by: Jonathan Druart --- installer/data/mysql/atomicupdate/bug_30403.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/installer/data/mysql/atomicupdate/bug_30403.pl b/installer/data/mysql/atomicupdate/bug_30403.pl index 4e91ec1de7c..c3915d4c630 100755 --- a/installer/data/mysql/atomicupdate/bug_30403.pl +++ b/installer/data/mysql/atomicupdate/bug_30403.pl @@ -7,12 +7,12 @@ return { my ($args) = @_; my ( $dbh, $out ) = @$args{qw(dbh out)}; - $dbh->do( + my $inserted = $dbh->do( q{ INSERT IGNORE INTO systempreferences ( variable, value, options, explanation, type ) VALUES ('UpdateNotForLoanStatusOnCheckout', '', 'NULL', 'This is a list of value pairs. When an item is checked out, if the not for loan value on the left matches the items not for loan value it will be updated to the right-hand value. E.g. ''-1: 0'' will cause an item that was set to ''Ordered'' to now be available for loan. Each pair of values should be on a separate line.', 'Free') } ); - say $out "Added new system preference 'UpdateNotForLoanStatusOnCheckout'"; + say $out ( $inserted == 1 ) ? "Added new system preference 'UpdateNotForLoanStatusOnCheckout'" : "Skipped - System preference exists already in DB" }, }; -- 2.25.1