Bugzilla – Attachment 187459 Details for
Bug 26993
Allow StoreLastBorrower to retain a locally-defined number of previous borrowers
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26993: Use FOREIGN_KEY_CHECKS
Bug-26993-Use-FOREIGNKEYCHECKS.patch (text/plain), 1.78 KB, created by
Jonathan Druart
on 2025-10-06 11:26:56 UTC
(
hide
)
Description:
Bug 26993: Use FOREIGN_KEY_CHECKS
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2025-10-06 11:26:56 UTC
Size:
1.78 KB
patch
obsolete
>From acf9788863b8774aa1fc0b70817a1f82bb04f0c4 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 6 Oct 2025 13:26:44 +0200 >Subject: [PATCH] Bug 26993: Use FOREIGN_KEY_CHECKS > >--- > .../data/mysql/atomicupdate/bug_26993.pl | 19 ++----------------- > 1 file changed, 2 insertions(+), 17 deletions(-) > >diff --git a/installer/data/mysql/atomicupdate/bug_26993.pl b/installer/data/mysql/atomicupdate/bug_26993.pl >index 4e062eb9657..409a1a07b19 100755 >--- a/installer/data/mysql/atomicupdate/bug_26993.pl >+++ b/installer/data/mysql/atomicupdate/bug_26993.pl >@@ -8,14 +8,8 @@ return { > my ($args) = @_; > my ( $dbh, $out ) = @$args{qw(dbh out)}; > >- # Drop the foreign key constraint temporarily > if ( index_exists( 'items_last_borrower', 'itemnumber' ) ) { >- $dbh->do( >- q{ >- ALTER TABLE items_last_borrower >- DROP FOREIGN KEY items_last_borrower_ibfk_1 >- } >- ); >+ $dbh->do('SET FOREIGN_KEY_CHECKS=0'); > > # Drop the unique index > $dbh->do( >@@ -23,16 +17,7 @@ return { > ALTER TABLE items_last_borrower DROP INDEX itemnumber > } > ); >- >- # Put the FK constraint back, without itemnumber having to be unique >- $dbh->do( >- q{ >- ALTER TABLE items_last_borrower >- ADD CONSTRAINT items_last_borrower_ibfk_1 >- FOREIGN KEY (itemnumber) REFERENCES items (itemnumber) >- ON DELETE CASCADE ON UPDATE CASCADE >- } >- ); >+ $dbh->do('SET FOREIGN_KEY_CHECKS=1'); > > say_success( $out, "Adjusted foreign key constraints on items_last_borrower table" ); > } >-- >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 26993
:
186773
|
186774
|
186775
|
186776
|
186801
|
186805
|
186806
|
186807
|
186808
|
186809
|
186844
|
186853
|
187311
|
187312
|
187313
|
187314
|
187315
|
187316
| 187459 |
187460
|
187483
|
187484