View | Details | Raw Unified | Return to bug 31626
Collapse All | Expand All

(-)a/installer/data/mysql/atomicupdate/bug_31626.pl (-5 / +9 lines)
Lines 6-15 return { Link Here
6
    up => sub {
6
    up => sub {
7
        my ($args) = @_;
7
        my ($args) = @_;
8
        my ($dbh, $out) = @$args{qw(dbh out)};
8
        my ($dbh, $out) = @$args{qw(dbh out)};
9
        $dbh->do(q{
9
        unless ( column_exists( 'message_queue', 'letter_id' ) ) {
10
            ALTER TABLE message_queue
10
            $dbh->do(q{
11
            ADD COLUMN letter_id INT(11) NULL DEFAULT NULL AFTER message_id,
11
                ALTER TABLE message_queue
12
            ADD CONSTRAINT letter_fk FOREIGN KEY (letter_id) REFERENCES letter(id) ON DELETE SET NULL ON UPDATE CASCADE
12
                ADD COLUMN `letter_id` int(11) DEFAULT NULL COMMENT 'Foreign key to the letters table' AFTER message_id,
13
        });
13
                ADD CONSTRAINT letter_fk FOREIGN KEY (letter_id) REFERENCES letter(id) ON DELETE SET NULL ON UPDATE CASCADE
14
            });
15
16
            say $out "Added 'letter_id' column to 'message_queue' table";
17
        }
14
    },
18
    },
15
};
19
};
(-)a/installer/data/mysql/kohastructure.sql (-2 / +1 lines)
Lines 3847-3853 DROP TABLE IF EXISTS `message_queue`; Link Here
3847
/*!40101 SET character_set_client = utf8 */;
3847
/*!40101 SET character_set_client = utf8 */;
3848
CREATE TABLE `message_queue` (
3848
CREATE TABLE `message_queue` (
3849
  `message_id` int(11) NOT NULL AUTO_INCREMENT,
3849
  `message_id` int(11) NOT NULL AUTO_INCREMENT,
3850
  `letter_id` int(11) DEFAULT NULL,
3850
  `letter_id` int(11) DEFAULT NULL COMMENT 'Foreign key to the letters table',
3851
  `borrowernumber` int(11) DEFAULT NULL,
3851
  `borrowernumber` int(11) DEFAULT NULL,
3852
  `subject` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL,
3852
  `subject` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL,
3853
  `content` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL,
3853
  `content` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL,
3854
- 

Return to bug 31626