From 172b13568eae2e41556daf2ea7f097900a12ab0c Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Mon, 18 Sep 2023 15:24:35 +0100 Subject: [PATCH] Bug 12532: (QA follow-up) Add cc_address to message_queue Add the cc_address field to the message_queue so we may report back that an email was copied to the guarantor email addresses. --- .../bug_12532-RedirectGuaranteeEmail_syspref.pl | 12 ++++++++++-- installer/data/mysql/kohastructure.sql | 1 + 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/installer/data/mysql/atomicupdate/bug_12532-RedirectGuaranteeEmail_syspref.pl b/installer/data/mysql/atomicupdate/bug_12532-RedirectGuaranteeEmail_syspref.pl index 36d29a5a5d7..cd1add64b38 100755 --- a/installer/data/mysql/atomicupdate/bug_12532-RedirectGuaranteeEmail_syspref.pl +++ b/installer/data/mysql/atomicupdate/bug_12532-RedirectGuaranteeEmail_syspref.pl @@ -2,7 +2,7 @@ use Modern::Perl; return { bug_number => "12532", - description => "Add new system preference RedirectGuaranteeEmail", + description => "Add new system preference RedirectGuaranteeEmail and cc_address field", up => sub { my ($args) = @_; my ( $dbh, $out ) = @$args{qw(dbh out)}; @@ -13,7 +13,15 @@ return { VALUES ('RedirectGuaranteeEmail', '0', 'Enable the ability to redirect guarantee email messages to guarantor.', NULL, 'YesNo') } ); - say $out "Added system preference 'RedirectGuaranteeEmail'"; + + unless ( column_exists( 'message_queue', 'cc_address' ) ) { + $dbh->do(q{ + ALTER TABLE `message_queue` + ADD COLUMN `cc_address` longtext DEFAULT NULL + AFTER `to_address` + }); + say $out "Added column 'cc_address'"; + } }, }; diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 21f6ec015c1..3d76eda5cbc 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -4300,6 +4300,7 @@ CREATE TABLE `message_queue` ( `time_queued` timestamp NULL DEFAULT NULL, `updated_on` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `to_address` longtext DEFAULT NULL, + `cc_address` longtext DEFAULT NULL, `from_address` longtext DEFAULT NULL, `reply_address` longtext DEFAULT NULL, `content_type` mediumtext DEFAULT NULL, -- 2.41.0