From 55445e2e2a17ac020c53d7b2bd4bc1e14ca98dbf 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 --- ...ug_12029_-_add_messages.patron_read_date_column.pl | 19 +++++++++++++++++++ installer/data/mysql/kohastructure.sql | 1 + 2 files changed, 20 insertions(+) create mode 100644 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 100644 index 00000000000..bc8265f2de3 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_12029_-_add_messages.patron_read_date_column.pl @@ -0,0 +1,19 @@ +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 03d6cbebc90..daaceac512c 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -4289,6 +4289,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.11.0