Bugzilla – Attachment 124662 Details for
Bug 28972
Add missing foreign key constraints to holds queue table
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28972: Add missing foreign key constraints to holds queue table
Bug-28972-Add-missing-foreign-key-constraints-to-h.patch (text/plain), 2.82 KB, created by
David Nind
on 2021-09-08 19:24:14 UTC
(
hide
)
Description:
Bug 28972: Add missing foreign key constraints to holds queue table
Filename:
MIME Type:
Creator:
David Nind
Created:
2021-09-08 19:24:14 UTC
Size:
2.82 KB
patch
obsolete
>From 7a1b723ebd94e7f70dd2ce77536a64d85bf7b7d7 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Wed, 8 Sep 2021 08:02:05 -0400 >Subject: [PATCH] Bug 28972: Add missing foreign key constraints to holds queue > table > >The table tmp_holdsqueue is missing a couple key constraints that should >be there, one for biblio and one for borrowers. > >Test Plan: >1) "SHOW CREATE TABLE tmp_holdsqueue;" should show no FKs for biblio or borrowers >2) Apply this patch >3) Run updatedatabase.pl >4) "SHOW CREATE TABLE tmp_holdsqueue;" should now show FKs for biblio or borrowers > >Signed-off-by: David Nind <david@davidnind.com> >--- > installer/data/mysql/atomicupdate/bug_28972.pl | 15 +++++++++++++++ > installer/data/mysql/kohastructure.sql | 4 +++- > 2 files changed, 18 insertions(+), 1 deletion(-) > create mode 100755 installer/data/mysql/atomicupdate/bug_28972.pl > >diff --git a/installer/data/mysql/atomicupdate/bug_28972.pl b/installer/data/mysql/atomicupdate/bug_28972.pl >new file mode 100755 >index 0000000000..c475ae5fe5 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_28972.pl >@@ -0,0 +1,15 @@ >+use Modern::Perl; >+ >+return { >+ bug_number => "28972", >+ description => "Add missing foreign key constraints to holds queue table", >+ up => sub { >+ my ($args) = @_; >+ my ($dbh, $out) = @$args{qw(dbh out)}; >+ $dbh->do(q{ >+ ALTER TABLE tmp_holdsqueue >+ ADD CONSTRAINT `tmp_holdsqueue_ibfk_2` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE, >+ ADD CONSTRAINT `tmp_holdsqueue_ibfk_3` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE >+ }); >+ }, >+} >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index 02cf864ddd..f9e5c6453e 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -5103,7 +5103,9 @@ CREATE TABLE `tmp_holdsqueue` ( > `notes` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL, > `item_level_request` tinyint(4) NOT NULL DEFAULT 0, > KEY `tmp_holdsqueue_ibfk_1` (`itemnumber`), >- CONSTRAINT `tmp_holdsqueue_ibfk_1` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE >+ CONSTRAINT `tmp_holdsqueue_ibfk_1` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE, >+ CONSTRAINT `tmp_holdsqueue_ibfk_2` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE, >+ CONSTRAINT `tmp_holdsqueue_ibfk_3` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE > ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; > /*!40101 SET character_set_client = @saved_cs_client */; > >-- >2.20.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 28972
:
124651
|
124662
|
125025
|
125055
|
125065