From 0f65552eb69ea4523dc1d82dc750b2c2b3ce212a Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 7 Nov 2024 15:10:01 +0100 Subject: [PATCH] Bug 38394: Remove existing try/catch and say_failure from DB revs On bug 37895 we have failed to propose a solution to encapsulate exceptions and rethrow them. Until this is ready we should not try/catch and so use say_failure from our DB revs. We want to stop the DB update process when something is wrong. In those try/catch we are actually continuing even if something bad happens. As RaiseError is set on the dbh, say_failure statements will never be reached. Test plan: checkout origin/24.05.0 reset_all checkout main + this patch updatedatabase Everything should run fine. --- installer/data/mysql/atomicupdate/skeleton.pl | 3 +-- installer/data/mysql/db_revs/231200044.pl | 2 +- installer/data/mysql/db_revs/231200051.pl | 2 +- installer/data/mysql/db_revs/231200054.pl | 2 +- installer/data/mysql/db_revs/231200059.pl | 2 +- installer/data/mysql/db_revs/231200060.pl | 2 +- installer/data/mysql/db_revs/231200061.pl | 2 +- installer/data/mysql/db_revs/240600001.pl | 2 +- installer/data/mysql/db_revs/240600002.pl | 2 +- installer/data/mysql/db_revs/240600003.pl | 2 +- installer/data/mysql/db_revs/240600004.pl | 2 +- installer/data/mysql/db_revs/240600005.pl | 2 +- installer/data/mysql/db_revs/240600006.pl | 2 +- installer/data/mysql/db_revs/240600007.pl | 20 +++++----------- installer/data/mysql/db_revs/240600008.pl | 2 +- installer/data/mysql/db_revs/240600009.pl | 2 +- installer/data/mysql/db_revs/240600010.pl | 2 +- installer/data/mysql/db_revs/240600011.pl | 2 +- installer/data/mysql/db_revs/240600012.pl | 2 +- installer/data/mysql/db_revs/240600013.pl | 2 +- installer/data/mysql/db_revs/240600014.pl | 2 +- installer/data/mysql/db_revs/240600015.pl | 2 +- installer/data/mysql/db_revs/240600016.pl | 2 +- installer/data/mysql/db_revs/240600017.pl | 2 +- installer/data/mysql/db_revs/240600018.pl | 2 +- installer/data/mysql/db_revs/240600019.pl | 2 +- installer/data/mysql/db_revs/240600020.pl | 2 +- installer/data/mysql/db_revs/240600021.pl | 2 +- installer/data/mysql/db_revs/240600022.pl | 2 +- installer/data/mysql/db_revs/240600023.pl | 2 +- installer/data/mysql/db_revs/240600024.pl | 2 +- installer/data/mysql/db_revs/240600025.pl | 2 +- installer/data/mysql/db_revs/240600026.pl | 2 +- installer/data/mysql/db_revs/240600027.pl | 2 +- installer/data/mysql/db_revs/240600028.pl | 2 +- installer/data/mysql/db_revs/240600029.pl | 23 ++++++------------- installer/data/mysql/db_revs/240600030.pl | 9 +++----- installer/data/mysql/db_revs/240600031.pl | 2 +- installer/data/mysql/db_revs/240600032.pl | 2 +- installer/data/mysql/db_revs/240600033.pl | 2 +- installer/data/mysql/db_revs/240600034.pl | 22 ++++++++---------- installer/data/mysql/db_revs/240600036.pl | 2 +- installer/data/mysql/db_revs/240600037.pl | 2 +- installer/data/mysql/db_revs/240600038.pl | 2 +- installer/data/mysql/db_revs/240600039.pl | 2 +- installer/data/mysql/db_revs/240600040.pl | 14 ++++------- installer/data/mysql/db_revs/240600041.pl | 2 +- installer/data/mysql/db_revs/240600042.pl | 2 +- installer/data/mysql/db_revs/240600043.pl | 9 +++----- installer/data/mysql/db_revs/240600044.pl | 2 +- installer/data/mysql/db_revs/240600045.pl | 2 +- installer/data/mysql/db_revs/240600046.pl | 2 +- installer/data/mysql/db_revs/240600047.pl | 2 +- installer/data/mysql/db_revs/240600048.pl | 2 +- installer/data/mysql/db_revs/240600049.pl | 2 +- installer/data/mysql/db_revs/240600050.pl | 2 +- installer/data/mysql/db_revs/240600051.pl | 2 +- installer/data/mysql/db_revs/240600052.pl | 2 +- installer/data/mysql/db_revs/240600053.pl | 19 +++++---------- installer/data/mysql/db_revs/240600054.pl | 2 +- installer/data/mysql/db_revs/240600055.pl | 2 +- 61 files changed, 93 insertions(+), 132 deletions(-) diff --git a/installer/data/mysql/atomicupdate/skeleton.pl b/installer/data/mysql/atomicupdate/skeleton.pl index 9e5738136b8..cece7c88196 100755 --- a/installer/data/mysql/atomicupdate/skeleton.pl +++ b/installer/data/mysql/atomicupdate/skeleton.pl @@ -1,5 +1,5 @@ use Modern::Perl; -use Koha::Installer::Output qw(say_warning say_failure say_success say_info); +use Koha::Installer::Output qw(say_warning say_success say_info); return { bug_number => "BUG_NUMBER", @@ -31,7 +31,6 @@ return { say $out "Added 'XXX' HTML customization"; # Other information - say_failure( $out, "Use red for danger/failure" ); say_success( $out, "Use green for success" ); say_warning( $out, "Use yellow for warning/a call to action" ); say_info( $out, "Use blue for further information" ); diff --git a/installer/data/mysql/db_revs/231200044.pl b/installer/data/mysql/db_revs/231200044.pl index 7db75f74f06..710e1a41cb6 100755 --- a/installer/data/mysql/db_revs/231200044.pl +++ b/installer/data/mysql/db_revs/231200044.pl @@ -1,5 +1,5 @@ use Modern::Perl; -use Koha::Installer::Output qw(say_warning say_failure say_success say_info); +use Koha::Installer::Output qw(say_warning say_success say_info); return { bug_number => "36120", diff --git a/installer/data/mysql/db_revs/231200051.pl b/installer/data/mysql/db_revs/231200051.pl index 7cb7083c18e..d805a162550 100755 --- a/installer/data/mysql/db_revs/231200051.pl +++ b/installer/data/mysql/db_revs/231200051.pl @@ -1,5 +1,5 @@ use Modern::Perl; -use Koha::Installer::Output qw(say_warning say_failure say_success say_info); +use Koha::Installer::Output qw(say_warning say_success say_info); return { bug_number => "31097", diff --git a/installer/data/mysql/db_revs/231200054.pl b/installer/data/mysql/db_revs/231200054.pl index a7624a749cd..4e0bce9ea38 100755 --- a/installer/data/mysql/db_revs/231200054.pl +++ b/installer/data/mysql/db_revs/231200054.pl @@ -1,5 +1,5 @@ use Modern::Perl; -use Koha::Installer::Output qw(say_warning say_failure say_success say_info); +use Koha::Installer::Output qw(say_warning say_success say_info); return { bug_number => "19768", diff --git a/installer/data/mysql/db_revs/231200059.pl b/installer/data/mysql/db_revs/231200059.pl index 78ca416ab6b..99685d1b747 100755 --- a/installer/data/mysql/db_revs/231200059.pl +++ b/installer/data/mysql/db_revs/231200059.pl @@ -1,5 +1,5 @@ use Modern::Perl; -use Koha::Installer::Output qw(say_warning say_failure say_success say_info); +use Koha::Installer::Output qw(say_warning say_success say_info); return { bug_number => "36819", diff --git a/installer/data/mysql/db_revs/231200060.pl b/installer/data/mysql/db_revs/231200060.pl index 57478817020..5c000eb7c12 100755 --- a/installer/data/mysql/db_revs/231200060.pl +++ b/installer/data/mysql/db_revs/231200060.pl @@ -1,5 +1,5 @@ use Modern::Perl; -use Koha::Installer::Output qw(say_warning say_failure say_success say_info); +use Koha::Installer::Output qw(say_warning say_success say_info); return { bug_number => "36665", diff --git a/installer/data/mysql/db_revs/231200061.pl b/installer/data/mysql/db_revs/231200061.pl index c1858761412..56fa26299d0 100755 --- a/installer/data/mysql/db_revs/231200061.pl +++ b/installer/data/mysql/db_revs/231200061.pl @@ -1,5 +1,5 @@ use Modern::Perl; -use Koha::Installer::Output qw(say_warning say_failure say_success say_info); +use Koha::Installer::Output qw(say_warning say_success say_info); return { bug_number => "26176", diff --git a/installer/data/mysql/db_revs/240600001.pl b/installer/data/mysql/db_revs/240600001.pl index a0e8f231222..ac279beb9b9 100755 --- a/installer/data/mysql/db_revs/240600001.pl +++ b/installer/data/mysql/db_revs/240600001.pl @@ -1,5 +1,5 @@ use Modern::Perl; -use Koha::Installer::Output qw(say_warning say_failure say_success say_info); +use Koha::Installer::Output qw(say_warning say_success say_info); return { bug_number => "36986", diff --git a/installer/data/mysql/db_revs/240600002.pl b/installer/data/mysql/db_revs/240600002.pl index 0aee778d927..1ee808529b2 100755 --- a/installer/data/mysql/db_revs/240600002.pl +++ b/installer/data/mysql/db_revs/240600002.pl @@ -1,5 +1,5 @@ use Modern::Perl; -use Koha::Installer::Output qw(say_warning say_failure say_success say_info); +use Koha::Installer::Output qw(say_warning say_success say_info); return { bug_number => "36453", diff --git a/installer/data/mysql/db_revs/240600003.pl b/installer/data/mysql/db_revs/240600003.pl index 92f68b70b08..4a2d0e6e321 100755 --- a/installer/data/mysql/db_revs/240600003.pl +++ b/installer/data/mysql/db_revs/240600003.pl @@ -1,5 +1,5 @@ use Modern::Perl; -use Koha::Installer::Output qw(say_warning say_failure say_success say_info); +use Koha::Installer::Output qw(say_warning say_success say_info); return { bug_number => "34597", diff --git a/installer/data/mysql/db_revs/240600004.pl b/installer/data/mysql/db_revs/240600004.pl index 31f311a8dc9..ef701c681a3 100755 --- a/installer/data/mysql/db_revs/240600004.pl +++ b/installer/data/mysql/db_revs/240600004.pl @@ -1,5 +1,5 @@ use Modern::Perl; -use Koha::Installer::Output qw(say_warning say_failure say_success say_info); +use Koha::Installer::Output qw(say_warning say_success say_info); return { bug_number => "18493", diff --git a/installer/data/mysql/db_revs/240600005.pl b/installer/data/mysql/db_revs/240600005.pl index 60616e78ac3..bad2e359fa3 100755 --- a/installer/data/mysql/db_revs/240600005.pl +++ b/installer/data/mysql/db_revs/240600005.pl @@ -1,5 +1,5 @@ use Modern::Perl; -use Koha::Installer::Output qw(say_warning say_failure say_success say_info); +use Koha::Installer::Output qw(say_warning say_success say_info); return { bug_number => "35639", diff --git a/installer/data/mysql/db_revs/240600006.pl b/installer/data/mysql/db_revs/240600006.pl index b1a1d481252..eaa51e33e29 100755 --- a/installer/data/mysql/db_revs/240600006.pl +++ b/installer/data/mysql/db_revs/240600006.pl @@ -1,5 +1,5 @@ use Modern::Perl; -use Koha::Installer::Output qw(say_warning say_failure say_success say_info); +use Koha::Installer::Output qw(say_warning say_success say_info); return { bug_number => "35597", diff --git a/installer/data/mysql/db_revs/240600007.pl b/installer/data/mysql/db_revs/240600007.pl index 41be7724604..add1e163d6a 100755 --- a/installer/data/mysql/db_revs/240600007.pl +++ b/installer/data/mysql/db_revs/240600007.pl @@ -1,5 +1,5 @@ use Modern::Perl; -use Koha::Installer::Output qw(say_warning say_failure say_success say_info); +use Koha::Installer::Output qw(say_warning say_success say_info); return { bug_number => "36330", @@ -9,22 +9,14 @@ return { my ( $dbh, $out ) = @$args{qw(dbh out)}; # Update columns, only changing the COMMENT - my $affected1 = $dbh->do( + $dbh->do( q{ ALTER TABLE course_items MODIFY `location` varchar(80) DEFAULT NULL COMMENT 'new shelving location for the item to have while on reserve (optional)' } ); - if ($affected1) { - say_success( $out, "Comment for course_items.location was updated." ); - } else { - say_failure( $out, "Comment for course_items.location was not updated." ); - } - my $affected2 = $dbh->do( + say_success( $out, "Comment for course_items.location was updated." ); + + $dbh->do( q{ ALTER TABLE course_items MODIFY `enabled` enum('yes','no') NOT NULL DEFAULT 'no' COMMENT 'if at least one enabled course has this item on reserve, this field will be ''yes'', otherwise it will be ''no''' } ); - if ($affected2) { - say_success( $out, "Comment for course_items.enabled was updated." ); - } else { - say_failure( $out, "Comment for course_items.enabled was not updated." ); - } - + say_success( $out, "Comment for course_items.enabled was updated." ); }, }; diff --git a/installer/data/mysql/db_revs/240600008.pl b/installer/data/mysql/db_revs/240600008.pl index 75e0a9d19b6..1f114cf44d9 100755 --- a/installer/data/mysql/db_revs/240600008.pl +++ b/installer/data/mysql/db_revs/240600008.pl @@ -1,5 +1,5 @@ use Modern::Perl; -use Koha::Installer::Output qw(say_warning say_failure say_success say_info); +use Koha::Installer::Output qw(say_warning say_success say_info); return { bug_number => "35153", diff --git a/installer/data/mysql/db_revs/240600009.pl b/installer/data/mysql/db_revs/240600009.pl index e9ba72e6d4f..fe17411ce75 100755 --- a/installer/data/mysql/db_revs/240600009.pl +++ b/installer/data/mysql/db_revs/240600009.pl @@ -1,5 +1,5 @@ use Modern::Perl; -use Koha::Installer::Output qw(say_warning say_failure say_success say_info); +use Koha::Installer::Output qw(say_warning say_success say_info); return { bug_number => "33317", diff --git a/installer/data/mysql/db_revs/240600010.pl b/installer/data/mysql/db_revs/240600010.pl index 0bfab138b47..57465ac8c68 100755 --- a/installer/data/mysql/db_revs/240600010.pl +++ b/installer/data/mysql/db_revs/240600010.pl @@ -1,5 +1,5 @@ use Modern::Perl; -use Koha::Installer::Output qw(say_warning say_failure say_success say_info); +use Koha::Installer::Output qw(say_warning say_success say_info); return { bug_number => "34481", diff --git a/installer/data/mysql/db_revs/240600011.pl b/installer/data/mysql/db_revs/240600011.pl index 115868b20d1..af9c867086f 100755 --- a/installer/data/mysql/db_revs/240600011.pl +++ b/installer/data/mysql/db_revs/240600011.pl @@ -1,5 +1,5 @@ use Modern::Perl; -use Koha::Installer::Output qw(say_warning say_failure say_success say_info); +use Koha::Installer::Output qw(say_warning say_success say_info); return { bug_number => "37216", diff --git a/installer/data/mysql/db_revs/240600012.pl b/installer/data/mysql/db_revs/240600012.pl index baced2cb5a1..c9daba5ced3 100755 --- a/installer/data/mysql/db_revs/240600012.pl +++ b/installer/data/mysql/db_revs/240600012.pl @@ -1,5 +1,5 @@ use Modern::Perl; -use Koha::Installer::Output qw(say_warning say_failure say_success say_info); +use Koha::Installer::Output qw(say_warning say_success say_info); return { bug_number => "26205", diff --git a/installer/data/mysql/db_revs/240600013.pl b/installer/data/mysql/db_revs/240600013.pl index d0d170a0d3b..e0fbe35a52a 100755 --- a/installer/data/mysql/db_revs/240600013.pl +++ b/installer/data/mysql/db_revs/240600013.pl @@ -1,5 +1,5 @@ use Modern::Perl; -use Koha::Installer::Output qw(say_warning say_failure say_success say_info); +use Koha::Installer::Output qw(say_warning say_success say_info); return { bug_number => "18317", diff --git a/installer/data/mysql/db_revs/240600014.pl b/installer/data/mysql/db_revs/240600014.pl index aef8f3a75cd..9f5c2c37210 100755 --- a/installer/data/mysql/db_revs/240600014.pl +++ b/installer/data/mysql/db_revs/240600014.pl @@ -1,5 +1,5 @@ use Modern::Perl; -use Koha::Installer::Output qw(say_warning say_failure say_success say_info); +use Koha::Installer::Output qw(say_warning say_success say_info); return { bug_number => "33363", diff --git a/installer/data/mysql/db_revs/240600015.pl b/installer/data/mysql/db_revs/240600015.pl index 3ee123f615b..9e91dc53240 100755 --- a/installer/data/mysql/db_revs/240600015.pl +++ b/installer/data/mysql/db_revs/240600015.pl @@ -1,5 +1,5 @@ use Modern::Perl; -use Koha::Installer::Output qw(say_warning say_failure say_success say_info); +use Koha::Installer::Output qw(say_warning say_success say_info); return { bug_number => "36453", diff --git a/installer/data/mysql/db_revs/240600016.pl b/installer/data/mysql/db_revs/240600016.pl index 9b8e847a54b..03251ae76c7 100755 --- a/installer/data/mysql/db_revs/240600016.pl +++ b/installer/data/mysql/db_revs/240600016.pl @@ -1,5 +1,5 @@ use Modern::Perl; -use Koha::Installer::Output qw(say_warning say_failure say_success say_info); +use Koha::Installer::Output qw(say_warning say_success say_info); return { bug_number => "28924", diff --git a/installer/data/mysql/db_revs/240600017.pl b/installer/data/mysql/db_revs/240600017.pl index 7c89bf1dcf5..f350dfb327d 100755 --- a/installer/data/mysql/db_revs/240600017.pl +++ b/installer/data/mysql/db_revs/240600017.pl @@ -1,5 +1,5 @@ use Modern::Perl; -use Koha::Installer::Output qw(say_warning say_failure say_success say_info); +use Koha::Installer::Output qw(say_warning say_success say_info); return { bug_number => "13888", diff --git a/installer/data/mysql/db_revs/240600018.pl b/installer/data/mysql/db_revs/240600018.pl index 891a6cd3830..5b528118748 100755 --- a/installer/data/mysql/db_revs/240600018.pl +++ b/installer/data/mysql/db_revs/240600018.pl @@ -1,5 +1,5 @@ use Modern::Perl; -use Koha::Installer::Output qw(say_warning say_failure say_success say_info); +use Koha::Installer::Output qw(say_warning say_success say_info); use Array::Utils qw( array_minus ); return { diff --git a/installer/data/mysql/db_revs/240600019.pl b/installer/data/mysql/db_revs/240600019.pl index 7b787330fe7..88582cfef02 100755 --- a/installer/data/mysql/db_revs/240600019.pl +++ b/installer/data/mysql/db_revs/240600019.pl @@ -1,5 +1,5 @@ use Modern::Perl; -use Koha::Installer::Output qw(say_warning say_failure say_success say_info); +use Koha::Installer::Output qw(say_warning say_success say_info); return { bug_number => "23781", diff --git a/installer/data/mysql/db_revs/240600020.pl b/installer/data/mysql/db_revs/240600020.pl index 9cb9b1c2d63..522ab7c2579 100755 --- a/installer/data/mysql/db_revs/240600020.pl +++ b/installer/data/mysql/db_revs/240600020.pl @@ -1,5 +1,5 @@ use Modern::Perl; -use Koha::Installer::Output qw(say_warning say_failure say_success say_info); +use Koha::Installer::Output qw(say_warning say_success say_info); return { bug_number => "36996", diff --git a/installer/data/mysql/db_revs/240600021.pl b/installer/data/mysql/db_revs/240600021.pl index 3be0e21f2c0..7e7d5679560 100755 --- a/installer/data/mysql/db_revs/240600021.pl +++ b/installer/data/mysql/db_revs/240600021.pl @@ -1,5 +1,5 @@ use Modern::Perl; -use Koha::Installer::Output qw(say_warning say_failure say_success say_info); +use Koha::Installer::Output qw(say_warning say_success say_info); return { bug_number => "35539", diff --git a/installer/data/mysql/db_revs/240600022.pl b/installer/data/mysql/db_revs/240600022.pl index b39b42a10b8..17ee3d22a8f 100755 --- a/installer/data/mysql/db_revs/240600022.pl +++ b/installer/data/mysql/db_revs/240600022.pl @@ -1,5 +1,5 @@ use Modern::Perl; -use Koha::Installer::Output qw(say_warning say_failure say_success say_info); +use Koha::Installer::Output qw(say_warning say_success say_info); return { bug_number => "37419", diff --git a/installer/data/mysql/db_revs/240600023.pl b/installer/data/mysql/db_revs/240600023.pl index 4c1028dbf97..f70cba9ec8a 100755 --- a/installer/data/mysql/db_revs/240600023.pl +++ b/installer/data/mysql/db_revs/240600023.pl @@ -1,5 +1,5 @@ use Modern::Perl; -use Koha::Installer::Output qw(say_warning say_failure say_success say_info); +use Koha::Installer::Output qw(say_warning say_success say_info); return { bug_number => "36757", diff --git a/installer/data/mysql/db_revs/240600024.pl b/installer/data/mysql/db_revs/240600024.pl index a974da38a8a..10ee6a37056 100755 --- a/installer/data/mysql/db_revs/240600024.pl +++ b/installer/data/mysql/db_revs/240600024.pl @@ -1,5 +1,5 @@ use Modern::Perl; -use Koha::Installer::Output qw(say_warning say_failure say_success say_info); +use Koha::Installer::Output qw(say_warning say_success say_info); return { bug_number => "35044", diff --git a/installer/data/mysql/db_revs/240600025.pl b/installer/data/mysql/db_revs/240600025.pl index 29f237d18a3..3aa6372c07e 100755 --- a/installer/data/mysql/db_revs/240600025.pl +++ b/installer/data/mysql/db_revs/240600025.pl @@ -1,5 +1,5 @@ use Modern::Perl; -use Koha::Installer::Output qw(say_warning say_failure say_success say_info); +use Koha::Installer::Output qw(say_warning say_success say_info); return { bug_number => "26777", diff --git a/installer/data/mysql/db_revs/240600026.pl b/installer/data/mysql/db_revs/240600026.pl index 6363b4218c7..6bf57eb6c6e 100755 --- a/installer/data/mysql/db_revs/240600026.pl +++ b/installer/data/mysql/db_revs/240600026.pl @@ -1,5 +1,5 @@ use Modern::Perl; -use Koha::Installer::Output qw(say_warning say_failure say_success say_info); +use Koha::Installer::Output qw(say_warning say_success say_info); return { bug_number => "20411", diff --git a/installer/data/mysql/db_revs/240600027.pl b/installer/data/mysql/db_revs/240600027.pl index 24a79188298..6576e394d9f 100755 --- a/installer/data/mysql/db_revs/240600027.pl +++ b/installer/data/mysql/db_revs/240600027.pl @@ -1,5 +1,5 @@ use Modern::Perl; -use Koha::Installer::Output qw(say_warning say_failure say_success say_info); +use Koha::Installer::Output qw(say_warning say_success say_info); return { bug_number => "27490", diff --git a/installer/data/mysql/db_revs/240600028.pl b/installer/data/mysql/db_revs/240600028.pl index 885f17b1a0a..77b9a441d4f 100755 --- a/installer/data/mysql/db_revs/240600028.pl +++ b/installer/data/mysql/db_revs/240600028.pl @@ -1,5 +1,5 @@ use Modern::Perl; -use Koha::Installer::Output qw(say_warning say_failure say_success say_info); +use Koha::Installer::Output qw(say_warning say_success say_info); return { bug_number => "37757", diff --git a/installer/data/mysql/db_revs/240600029.pl b/installer/data/mysql/db_revs/240600029.pl index 0c95f4f4251..34130aa5212 100755 --- a/installer/data/mysql/db_revs/240600029.pl +++ b/installer/data/mysql/db_revs/240600029.pl @@ -1,5 +1,5 @@ use Modern::Perl; -use Koha::Installer::Output qw(say_warning say_failure say_success say_info); +use Koha::Installer::Output qw(say_warning say_success say_info); return { bug_number => '37592', @@ -31,17 +31,11 @@ return { ALTER TABLE bookings ADD COLUMN modification_date DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'The datetime for when a booking has been updated' SQL if ( @{$existing_columns} == 0 ) { - if ( $dbh->do("$creation_date_statement AFTER `end_date`") ) { - say_success( $out, q{Added column 'bookings.creation_date'} ); - } else { - say_failure( $out, q{Failed to add column 'bookings.creation_date': } . $dbh->errstr ); - } + $dbh->do("$creation_date_statement AFTER `end_date`"); + say_success( $out, q{Added column 'bookings.creation_date'} ); - if ( $dbh->do("$modification_date_statement AFTER `creation_date`") ) { - say_success( $out, q{Added column 'bookings.modification_date'} ); - } else { - say_failure( $out, q{Failed to add column 'bookings.modification_date': } . $dbh->errstr ); - } + $dbh->do("$modification_date_statement AFTER `creation_date`"); + say_success( $out, q{Added column 'bookings.modification_date'} ); return; } @@ -61,11 +55,8 @@ return { $statement = "$modification_date_statement AFTER `creation_date`"; } - if ( $dbh->do($statement) ) { - say_success( $out, "Added column 'bookings.$column'" ); - } else { - say_failure( $out, "Failed to add column 'bookings.$column': " . $dbh->errstr ); - } + $dbh->do($statement); + say_success( $out, "Added column 'bookings.$column'" ); } } }, diff --git a/installer/data/mysql/db_revs/240600030.pl b/installer/data/mysql/db_revs/240600030.pl index 5e35688ac7d..b6f6682c5c7 100755 --- a/installer/data/mysql/db_revs/240600030.pl +++ b/installer/data/mysql/db_revs/240600030.pl @@ -1,5 +1,5 @@ use Modern::Perl; -use Koha::Installer::Output qw(say_warning say_failure say_success say_info); +use Koha::Installer::Output qw(say_warning say_success say_info); return { bug_number => '37601', @@ -20,10 +20,7 @@ return { ALTER TABLE `bookings` ADD COLUMN `status` ENUM('new', 'cancelled', 'completed') NOT NULL DEFAULT 'new' COMMENT 'current status of the booking' $after; SQL - if ( $dbh->do($statement) ) { - say_success( $out, q{Added column 'bookings.status'} ); - } else { - say_failure( $out, q{Failed to add column 'bookings.status'} ); - } + $dbh->do($statement); + say_success( $out, q{Added column 'bookings.status'} ); }, }; diff --git a/installer/data/mysql/db_revs/240600031.pl b/installer/data/mysql/db_revs/240600031.pl index 95e109c4906..40d26efbc2b 100755 --- a/installer/data/mysql/db_revs/240600031.pl +++ b/installer/data/mysql/db_revs/240600031.pl @@ -1,5 +1,5 @@ use Modern::Perl; -use Koha::Installer::Output qw(say_warning say_failure say_success say_info); +use Koha::Installer::Output qw(say_warning say_success say_info); return { bug_number => "23685", diff --git a/installer/data/mysql/db_revs/240600032.pl b/installer/data/mysql/db_revs/240600032.pl index a2bbcd1007d..469b1fa7302 100755 --- a/installer/data/mysql/db_revs/240600032.pl +++ b/installer/data/mysql/db_revs/240600032.pl @@ -1,5 +1,5 @@ use Modern::Perl; -use Koha::Installer::Output qw(say_warning say_failure say_success say_info); +use Koha::Installer::Output qw(say_warning say_success say_info); return { bug_number => "37856", diff --git a/installer/data/mysql/db_revs/240600033.pl b/installer/data/mysql/db_revs/240600033.pl index 2755d70c8bc..bde2003c94e 100755 --- a/installer/data/mysql/db_revs/240600033.pl +++ b/installer/data/mysql/db_revs/240600033.pl @@ -1,5 +1,5 @@ use Modern::Perl; -use Koha::Installer::Output qw(say_warning say_failure say_success say_info); +use Koha::Installer::Output qw(say_warning say_success say_info); return { bug_number => "35655", diff --git a/installer/data/mysql/db_revs/240600034.pl b/installer/data/mysql/db_revs/240600034.pl index e8494b948d9..b4bd0364285 100755 --- a/installer/data/mysql/db_revs/240600034.pl +++ b/installer/data/mysql/db_revs/240600034.pl @@ -1,5 +1,5 @@ use Modern::Perl; -use Koha::Installer::Output qw(say_warning say_failure say_success say_info); +use Koha::Installer::Output qw(say_warning say_success say_info); return { bug_number => "37967", @@ -8,17 +8,13 @@ return { my ($args) = @_; my ( $dbh, $out ) = @$args{qw(dbh out)}; - try { - $dbh->do( - q{ - INSERT IGNORE INTO message_transports (`message_attribute_id`, `message_transport_type`, `is_digest`, `letter_module`, `letter_code`) VALUES - (9, 'phone', 1, 'circulation', 'AUTO_RENEWALS_DGST'), - (9, 'phone', 0, 'circulation', 'AUTO_RENEWALS'); - } - ); - say_success( $out, "Added phone messaging transports for auto-renewals" ); - } catch { - say_failure( $out, "Error adding phone messaging transports for auto-renewals: $_" ); - }; + $dbh->do( + q{ + INSERT IGNORE INTO message_transports (`message_attribute_id`, `message_transport_type`, `is_digest`, `letter_module`, `letter_code`) VALUES + (9, 'phone', 1, 'circulation', 'AUTO_RENEWALS_DGST'), + (9, 'phone', 0, 'circulation', 'AUTO_RENEWALS'); + } + ); + say_success( $out, "Added phone messaging transports for auto-renewals" ); }, }; diff --git a/installer/data/mysql/db_revs/240600036.pl b/installer/data/mysql/db_revs/240600036.pl index 1c75e5b3ed7..774e5a88aa3 100755 --- a/installer/data/mysql/db_revs/240600036.pl +++ b/installer/data/mysql/db_revs/240600036.pl @@ -1,5 +1,5 @@ use Modern::Perl; -use Koha::Installer::Output qw(say_warning say_failure say_success say_info); +use Koha::Installer::Output qw(say_warning say_success say_info); return { bug_number => "37954", diff --git a/installer/data/mysql/db_revs/240600037.pl b/installer/data/mysql/db_revs/240600037.pl index 2b515a96841..7cd56dd3b8b 100755 --- a/installer/data/mysql/db_revs/240600037.pl +++ b/installer/data/mysql/db_revs/240600037.pl @@ -1,5 +1,5 @@ use Modern::Perl; -use Koha::Installer::Output qw(say_warning say_failure say_success say_info); +use Koha::Installer::Output qw(say_warning say_success say_info); return { bug_number => "36798", diff --git a/installer/data/mysql/db_revs/240600038.pl b/installer/data/mysql/db_revs/240600038.pl index bd535431266..2f036ed54bb 100755 --- a/installer/data/mysql/db_revs/240600038.pl +++ b/installer/data/mysql/db_revs/240600038.pl @@ -1,5 +1,5 @@ use Modern::Perl; -use Koha::Installer::Output qw(say_warning say_failure say_success say_info); +use Koha::Installer::Output qw(say_warning say_success say_info); return { bug_number => "36766", diff --git a/installer/data/mysql/db_revs/240600039.pl b/installer/data/mysql/db_revs/240600039.pl index 85935ea1c30..3068358d636 100755 --- a/installer/data/mysql/db_revs/240600039.pl +++ b/installer/data/mysql/db_revs/240600039.pl @@ -1,5 +1,5 @@ use Modern::Perl; -use Koha::Installer::Output qw(say_warning say_failure say_success say_info); +use Koha::Installer::Output qw(say_warning say_success say_info); return { bug_number => "28575", diff --git a/installer/data/mysql/db_revs/240600040.pl b/installer/data/mysql/db_revs/240600040.pl index f2f30c1bb12..639b8478167 100755 --- a/installer/data/mysql/db_revs/240600040.pl +++ b/installer/data/mysql/db_revs/240600040.pl @@ -1,5 +1,5 @@ use Modern::Perl; -use Koha::Installer::Output qw(say_warning say_failure say_success say_info); +use Koha::Installer::Output qw(say_warning say_success say_info); return { bug_number => "23295", @@ -14,14 +14,10 @@ return { say_success ( $out, "Added new system preference 'RestrictPatronsWithFailedNotices'" ); - try { - $dbh->do( - q{INSERT IGNORE INTO restriction_types (code, display_text, is_system, is_default) VALUES ('NOTICE_FAILURE_SUSPENSION', 'Notice failure suspension', 1, 0)} - ); - say_success( $out, "Added new system restriction type 'NOTICE_FAILURE_SUSPENSION'" ); - } catch { - say_failure( $out, "Database modification failed with errors: $_" ); - }; + $dbh->do( + q{INSERT IGNORE INTO restriction_types (code, display_text, is_system, is_default) VALUES ('NOTICE_FAILURE_SUSPENSION', 'Notice failure suspension', 1, 0)} + ); + say_success( $out, "Added new system restriction type 'NOTICE_FAILURE_SUSPENSION'" ); }, }; diff --git a/installer/data/mysql/db_revs/240600041.pl b/installer/data/mysql/db_revs/240600041.pl index e4bd7b3f258..a0f7eaf3ae2 100755 --- a/installer/data/mysql/db_revs/240600041.pl +++ b/installer/data/mysql/db_revs/240600041.pl @@ -1,5 +1,5 @@ use Modern::Perl; -use Koha::Installer::Output qw(say_warning say_failure say_success say_info); +use Koha::Installer::Output qw(say_warning say_success say_info); return { bug_number => "30955", diff --git a/installer/data/mysql/db_revs/240600042.pl b/installer/data/mysql/db_revs/240600042.pl index 2bae10ed569..aae3dbb0bac 100755 --- a/installer/data/mysql/db_revs/240600042.pl +++ b/installer/data/mysql/db_revs/240600042.pl @@ -1,5 +1,5 @@ use Modern::Perl; -use Koha::Installer::Output qw(say_warning say_failure say_success say_info); +use Koha::Installer::Output qw(say_warning say_success say_info); return { bug_number => "37969", diff --git a/installer/data/mysql/db_revs/240600043.pl b/installer/data/mysql/db_revs/240600043.pl index 58ef34c759b..6ec6803ffbd 100755 --- a/installer/data/mysql/db_revs/240600043.pl +++ b/installer/data/mysql/db_revs/240600043.pl @@ -1,5 +1,5 @@ use Modern::Perl; -use Koha::Installer::Output qw(say_warning say_failure say_success say_info); +use Koha::Installer::Output qw(say_warning say_success say_info); return { bug_number => '38193', @@ -18,10 +18,7 @@ return { ALTER TABLE `bookings` ADD COLUMN `cancellation_reason` varchar(80) DEFAULT NULL COMMENT 'optional authorised value BOOKING_CANCELLATION' AFTER `status`; SQL - if ( $dbh->do($statement) ) { - say_success( $out, q{Added column 'bookings.cancellation_reason'} ); - } else { - say_failure( $out, q{Failed to add column 'bookings.cancellation_reason'} ); - } + $dbh->do($statement); + say_success( $out, q{Added column 'bookings.cancellation_reason'} ); }, }; diff --git a/installer/data/mysql/db_revs/240600044.pl b/installer/data/mysql/db_revs/240600044.pl index fcaa1e4cdc1..16689cc19be 100755 --- a/installer/data/mysql/db_revs/240600044.pl +++ b/installer/data/mysql/db_revs/240600044.pl @@ -1,5 +1,5 @@ use Modern::Perl; -use Koha::Installer::Output qw(say_warning say_failure say_success say_info); +use Koha::Installer::Output qw(say_warning say_success say_info); return { bug_number => '28833', diff --git a/installer/data/mysql/db_revs/240600045.pl b/installer/data/mysql/db_revs/240600045.pl index 414d0301872..16975631ab1 100755 --- a/installer/data/mysql/db_revs/240600045.pl +++ b/installer/data/mysql/db_revs/240600045.pl @@ -1,5 +1,5 @@ use Modern::Perl; -use Koha::Installer::Output qw(say_warning say_failure say_success say_info); +use Koha::Installer::Output qw(say_warning say_success say_info); return { bug_number => "35906", diff --git a/installer/data/mysql/db_revs/240600046.pl b/installer/data/mysql/db_revs/240600046.pl index 7b4eb77bdcf..3da8c281cab 100755 --- a/installer/data/mysql/db_revs/240600046.pl +++ b/installer/data/mysql/db_revs/240600046.pl @@ -1,5 +1,5 @@ use Modern::Perl; -use Koha::Installer::Output qw(say_warning say_failure say_success say_info); +use Koha::Installer::Output qw(say_warning say_success say_info); return { bug_number => "38222", diff --git a/installer/data/mysql/db_revs/240600047.pl b/installer/data/mysql/db_revs/240600047.pl index bf0b989303d..1a34b91e8d5 100755 --- a/installer/data/mysql/db_revs/240600047.pl +++ b/installer/data/mysql/db_revs/240600047.pl @@ -1,5 +1,5 @@ use Modern::Perl; -use Koha::Installer::Output qw(say_warning say_failure say_success say_info); +use Koha::Installer::Output qw(say_warning say_success say_info); return { bug_number => "35659", diff --git a/installer/data/mysql/db_revs/240600048.pl b/installer/data/mysql/db_revs/240600048.pl index b77886f111f..0279e167881 100755 --- a/installer/data/mysql/db_revs/240600048.pl +++ b/installer/data/mysql/db_revs/240600048.pl @@ -1,5 +1,5 @@ use Modern::Perl; -use Koha::Installer::Output qw(say_warning say_failure say_success say_info); +use Koha::Installer::Output qw(say_warning say_success say_info); return { bug_number => "33484", diff --git a/installer/data/mysql/db_revs/240600049.pl b/installer/data/mysql/db_revs/240600049.pl index 310099d7c96..78e3951a5cf 100755 --- a/installer/data/mysql/db_revs/240600049.pl +++ b/installer/data/mysql/db_revs/240600049.pl @@ -1,5 +1,5 @@ use Modern::Perl; -use Koha::Installer::Output qw(say_warning say_failure say_success say_info); +use Koha::Installer::Output qw(say_warning say_success say_info); return { bug_number => "38274", diff --git a/installer/data/mysql/db_revs/240600050.pl b/installer/data/mysql/db_revs/240600050.pl index a6d1cf2f1bf..1a1d058efb5 100755 --- a/installer/data/mysql/db_revs/240600050.pl +++ b/installer/data/mysql/db_revs/240600050.pl @@ -1,5 +1,5 @@ use Modern::Perl; -use Koha::Installer::Output qw(say_warning say_failure say_success say_info); +use Koha::Installer::Output qw(say_warning say_success say_info); return { bug_number => "30648", diff --git a/installer/data/mysql/db_revs/240600051.pl b/installer/data/mysql/db_revs/240600051.pl index d7462cdd8eb..fb2e3d0de98 100755 --- a/installer/data/mysql/db_revs/240600051.pl +++ b/installer/data/mysql/db_revs/240600051.pl @@ -1,5 +1,5 @@ use Modern::Perl; -use Koha::Installer::Output qw(say_warning say_failure say_success say_info); +use Koha::Installer::Output qw(say_warning say_success say_info); return { bug_number => "14180", diff --git a/installer/data/mysql/db_revs/240600052.pl b/installer/data/mysql/db_revs/240600052.pl index 65643e24938..401809e9226 100755 --- a/installer/data/mysql/db_revs/240600052.pl +++ b/installer/data/mysql/db_revs/240600052.pl @@ -1,5 +1,5 @@ use Modern::Perl; -use Koha::Installer::Output qw(say_warning say_failure say_success say_info); +use Koha::Installer::Output qw(say_warning say_success say_info); return { bug_number => "35305", diff --git a/installer/data/mysql/db_revs/240600053.pl b/installer/data/mysql/db_revs/240600053.pl index 29bcda1c2aa..580e4b730af 100755 --- a/installer/data/mysql/db_revs/240600053.pl +++ b/installer/data/mysql/db_revs/240600053.pl @@ -1,5 +1,5 @@ use Modern::Perl; -use Koha::Installer::Output qw(say_warning say_failure say_success say_info); +use Koha::Installer::Output qw(say_warning say_success say_info); use Try::Tiny; return { @@ -10,19 +10,12 @@ return { my ( $dbh, $out ) = @$args{qw(dbh out)}; if ( !column_exists( 'currency', 'p_cs_precedes' ) ) { - try { - $dbh->do( - q{ + $dbh->do( + q{ ALTER TABLE `currency` ADD COLUMN `p_cs_precedes` tinyint(1) DEFAULT 1 AFTER p_sep_by_space - } - ); - say_success( $out, "Added column 'currency.p_cs_precedes'" ); - } catch { - say_failure( - $out, - "Adding column 'currency.p_cs_precedes' failed with errors: $_" - ); - }; + } + ); + say_success( $out, "Added column 'currency.p_cs_precedes'" ); } else { say_info( $out, "Column 'currency.p_cs_precedes' already exists" ); } diff --git a/installer/data/mysql/db_revs/240600054.pl b/installer/data/mysql/db_revs/240600054.pl index 588831b30c3..4de98de2cf3 100755 --- a/installer/data/mysql/db_revs/240600054.pl +++ b/installer/data/mysql/db_revs/240600054.pl @@ -1,5 +1,5 @@ use Modern::Perl; -use Koha::Installer::Output qw(say_warning say_failure say_success say_info); +use Koha::Installer::Output qw(say_warning say_success say_info); use C4::Context; use Koha::Reports; diff --git a/installer/data/mysql/db_revs/240600055.pl b/installer/data/mysql/db_revs/240600055.pl index 8eab26106b2..0beb5c5977d 100755 --- a/installer/data/mysql/db_revs/240600055.pl +++ b/installer/data/mysql/db_revs/240600055.pl @@ -1,5 +1,5 @@ use Modern::Perl; -use Koha::Installer::Output qw(say_warning say_failure say_success say_info); +use Koha::Installer::Output qw(say_warning say_success say_info); return { bug_number => "33462", -- 2.34.1