Bugzilla – Attachment 142054 Details for
Bug 31626
Add letter ID to the message queue table
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31626: (QA follow-up) Make db_rev robust
Bug-31626-QA-follow-up-Make-dbrev-robust.patch (text/plain), 2.25 KB, created by
Tomás Cohen Arazi (tcohen)
on 2022-10-18 12:49:26 UTC
(
hide
)
Description:
Bug 31626: (QA follow-up) Make db_rev robust
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2022-10-18 12:49:26 UTC
Size:
2.25 KB
patch
obsolete
>From a4409568b39a9fc0d3edd3606e30c40da8c8c4d0 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Tue, 18 Oct 2022 09:48:59 -0300 >Subject: [PATCH] Bug 31626: (QA follow-up) Make db_rev robust > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > installer/data/mysql/atomicupdate/bug_31626.pl | 14 +++++++++----- > installer/data/mysql/kohastructure.sql | 2 +- > 2 files changed, 10 insertions(+), 6 deletions(-) > >diff --git a/installer/data/mysql/atomicupdate/bug_31626.pl b/installer/data/mysql/atomicupdate/bug_31626.pl >index d02b3a88b15..e577e65829e 100755 >--- a/installer/data/mysql/atomicupdate/bug_31626.pl >+++ b/installer/data/mysql/atomicupdate/bug_31626.pl >@@ -6,10 +6,14 @@ return { > up => sub { > my ($args) = @_; > my ($dbh, $out) = @$args{qw(dbh out)}; >- $dbh->do(q{ >- ALTER TABLE message_queue >- ADD COLUMN letter_id INT(11) NULL DEFAULT NULL AFTER message_id, >- ADD CONSTRAINT letter_fk FOREIGN KEY (letter_id) REFERENCES letter(id) ON DELETE SET NULL ON UPDATE CASCADE >- }); >+ 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 'letter_id' column to 'message_queue' table"; >+ } > }, > }; >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index 37f8ca7353d..b0dea05b7bb 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -3847,7 +3847,7 @@ DROP TABLE IF EXISTS `message_queue`; > /*!40101 SET character_set_client = utf8 */; > CREATE TABLE `message_queue` ( > `message_id` int(11) NOT NULL AUTO_INCREMENT, >- `letter_id` int(11) DEFAULT NULL, >+ `letter_id` int(11) DEFAULT NULL COMMENT 'Foreign key to the letters table', > `borrowernumber` int(11) DEFAULT NULL, > `subject` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL, > `content` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL, >-- >2.34.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 31626
:
140996
|
140999
|
141001
|
141005
|
141006
|
141942
|
141943
| 142054