Bugzilla – Attachment 163827 Details for
Bug 35610
Missing FK on old_reserves.branchcode
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35610: Set branchcode to NULL before adding the FK
Bug-35610-Set-branchcode-to-NULL-before-adding-the.patch (text/plain), 1.17 KB, created by
Jonathan Druart
on 2024-03-25 15:51:21 UTC
(
hide
)
Description:
Bug 35610: Set branchcode to NULL before adding the FK
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2024-03-25 15:51:21 UTC
Size:
1.17 KB
patch
obsolete
>From 1bfa3d4b9b00e8bde9ffc73f735a440dbf9a740f Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 25 Mar 2024 16:51:01 +0100 >Subject: [PATCH] Bug 35610: Set branchcode to NULL before adding the FK > >--- > installer/data/mysql/atomicupdate/bug_35610.pl | 6 ++++++ > 1 file changed, 6 insertions(+) > >diff --git a/installer/data/mysql/atomicupdate/bug_35610.pl b/installer/data/mysql/atomicupdate/bug_35610.pl >index e9e2c107251..6143bd9e117 100755 >--- a/installer/data/mysql/atomicupdate/bug_35610.pl >+++ b/installer/data/mysql/atomicupdate/bug_35610.pl >@@ -8,6 +8,12 @@ return { > my ( $dbh, $out ) = @$args{qw(dbh out)}; > > unless ( foreign_key_exists('old_reserves', 'old_reserves_ibfk_branchcode') ) { >+ $dbh->do(q{ >+ UPDATE old_reserves >+ SET branchcode = NULL >+ WHERE branchcode NOT IN (SELECT branchcode FROM branches) >+ }); >+ > $dbh->do(q{ > ALTER TABLE old_reserves > ADD CONSTRAINT `old_reserves_ibfk_branchcode` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE SET NULL ON UPDATE CASCADE; >-- >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 35610
:
160097
|
160098
|
161540
|
163827
|
163966
|
163967
|
163968