From 56f16da47b942f7f9d1b6293462e876f6ed76d08 Mon Sep 17 00:00:00 2001 From: Aleisha Amohia Date: Wed, 15 Feb 2023 18:10:29 +1300 Subject: [PATCH] Bug 12029: Adding messages.patron_read_date column Signed-off-by: Christopher Brannon JD Amended patch: Fix QA failure "File must have the exec flag" Signed-off-by: Jonathan Druart Signed-off-by: Tomas Cohen Arazi --- ...9_-_add_messages.patron_read_date_column.pl | 18 ++++++++++++++++++ installer/data/mysql/kohastructure.sql | 1 + 2 files changed, 19 insertions(+) create mode 100755 installer/data/mysql/atomicupdate/bug_12029_-_add_messages.patron_read_date_column.pl diff --git a/installer/data/mysql/atomicupdate/bug_12029_-_add_messages.patron_read_date_column.pl b/installer/data/mysql/atomicupdate/bug_12029_-_add_messages.patron_read_date_column.pl new file mode 100755 index 0000000000..efbe1fccf0 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_12029_-_add_messages.patron_read_date_column.pl @@ -0,0 +1,18 @@ +use Modern::Perl; + +return { + bug_number => "12029", + description => "Enable users to dismiss their patron messages", + up => sub { + my ($args) = @_; + my ($dbh, $out) = @$args{qw(dbh out)}; + + if( !column_exists( 'messages', 'patron_read_date' ) ) { + $dbh->do(q{ + ALTER TABLE messages ADD COLUMN `patron_read_date` timestamp NULL DEFAULT NULL AFTER `manager_id` + }); + + say $out "Added column 'messages.patron_read_date'"; + } + }, +}; diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index e92ffc1121..50796112dc 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -4310,6 +4310,7 @@ CREATE TABLE `messages` ( `message` mediumtext NOT NULL COMMENT 'the text of the message', `message_date` timestamp NOT NULL DEFAULT current_timestamp() COMMENT 'the date and time the message was written', `manager_id` int(11) DEFAULT NULL COMMENT 'creator of message', + `patron_read_date` timestamp NULL DEFAULT NULL COMMENT 'the date and time the patron dismissed the message', PRIMARY KEY (`message_id`), KEY `messages_ibfk_1` (`manager_id`), KEY `messages_borrowernumber` (`borrowernumber`), -- 2.39.2