From 57f2bb4a1d74a3cd855f3ddd7d5cc8421eaab964 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johanna=20R=C3=A4is=C3=A4?= Date: Mon, 29 Jul 2024 09:03:26 +0300 Subject: [PATCH] Bug 28400: Add response_message column to message_queue table Test Plan: 1) Run the updatedatabase.pl script 2) Run update_dbix_class_files.pl 3) Check the message_queue table for the new column Sponsored-by: Koha-Suomi Oy --- C4/Letters.pm | 3 ++- .../data/mysql/atomicupdate/bug_28400.pl | 21 +++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100755 installer/data/mysql/atomicupdate/bug_28400.pl diff --git a/C4/Letters.pm b/C4/Letters.pm index 827b5d1087..673ce2de7d 100644 --- a/C4/Letters.pm +++ b/C4/Letters.pm @@ -1683,10 +1683,11 @@ sub _set_message_status { } my $dbh = C4::Context->dbh(); - my $statement = 'UPDATE message_queue SET status= ?, failure_code= ? WHERE message_id = ?'; + my $statement = 'UPDATE message_queue SET status= ?, failure_code= ?, response_message = ? WHERE message_id = ?'; my $sth = $dbh->prepare( $statement ); my $result = $sth->execute( $params->{'status'}, $params->{'failure_code'} || '', + $params->{'response_message'} || '', $params->{'message_id'} ); return $result; } diff --git a/installer/data/mysql/atomicupdate/bug_28400.pl b/installer/data/mysql/atomicupdate/bug_28400.pl new file mode 100755 index 0000000000..f50ebba123 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_28400.pl @@ -0,0 +1,21 @@ +use Modern::Perl; +use Koha::Installer::Output qw(say_warning say_failure say_success say_info); + +return { + bug_number => "28400", + description => "Add response_message column to message_queue table", + up => sub { + my ($args) = @_; + my ( $dbh, $out ) = @$args{qw(dbh out)}; + + if ( !column_exists( 'message_queue', 'response_message' ) ) { + $dbh->do(q{ + ALTER TABLE message_queue + ADD COLUMN response_message MEDIUMTEXT + }); + } + + # Print useful stuff here + say_success( $out, "Added column 'message_queue.response_message'" ); + }, +}; -- 2.34.1