Bug 12029: Adding messages.patron_read_date column

Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>

JD Amended patch: Fix QA failure "File must have the exec flag"

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Aleisha Amohia 2023-02-15 18:10:29 +13:00 committed by Tomas Cohen Arazi
parent 165c6b3118
commit 56f16da47b
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F
2 changed files with 19 additions and 0 deletions

View file

@ -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'";
}
},
};

View file

@ -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`),