Koha/installer/data/mysql/db_revs/220600066.pl
Tomas Cohen Arazi 7a413f8015
Bug 32191: Tidy upgrade scripts output
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-11-14 15:08:10 -03:00

19 lines
684 B
Perl
Executable file

use Modern::Perl;
return {
bug_number => "31626",
description => "Add letter id to the message queue table",
up => sub {
my ($args) = @_;
my ($dbh, $out) = @$args{qw(dbh out)};
unless ( column_exists( 'message_queue', 'letter_id' ) ) {
$dbh->do(q{
ALTER TABLE message_queue
ADD COLUMN `letter_id` int(11) DEFAULT NULL COMMENT 'Foreign key to the letters table' AFTER message_id,
ADD CONSTRAINT letter_fk FOREIGN KEY (letter_id) REFERENCES letter(id) ON DELETE SET NULL ON UPDATE CASCADE
});
say $out "Added column 'message_queue.letter_id'";
}
},
};