Bugzilla – Attachment 125055 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: Make DB rev idempotent
Bug-28972-Make-DB-rev-idempotent.patch (text/plain), 1.78 KB, created by
Jonathan Druart
on 2021-09-20 11:57:28 UTC
(
hide
)
Description:
Bug 28972: Make DB rev idempotent
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2021-09-20 11:57:28 UTC
Size:
1.78 KB
patch
obsolete
>From 3206e20f7de37f06840f53f04d786034da3fe03d Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 20 Sep 2021 13:57:06 +0200 >Subject: [PATCH] Bug 28972: Make DB rev idempotent > >--- > installer/data/mysql/atomicupdate/bug_28972.pl | 17 ++++++++++++----- > 1 file changed, 12 insertions(+), 5 deletions(-) > >diff --git a/installer/data/mysql/atomicupdate/bug_28972.pl b/installer/data/mysql/atomicupdate/bug_28972.pl >index c475ae5fe5e..12f52eac154 100755 >--- a/installer/data/mysql/atomicupdate/bug_28972.pl >+++ b/installer/data/mysql/atomicupdate/bug_28972.pl >@@ -6,10 +6,17 @@ return { > 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 >- }); >+ unless ( foreign_key_exists('tmp_holdsqueue', 'tmp_holdsqueue_ibfk_2') ) { >+ $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 >+ }); >+ } >+ unless ( foreign_key_exists('tmp_holdsqueue', 'tmp_holdsqueue_ibfk_2') ) { >+ $dbh->do(q{ >+ ALTER TABLE tmp_holdsqueue >+ ADD CONSTRAINT `tmp_holdsqueue_ibfk_3` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE >+ }); >+ } > }, > } >-- >2.25.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