Bugzilla – Attachment 127275 Details for
Bug 29409
Update for bug 25333 can fail due to bad data or constraints
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29409: Check for existence of constraint before deletion
Bug-29409-Check-for-existence-of-constraint-before.patch (text/plain), 1.31 KB, created by
Nick Clemens (kidclamp)
on 2021-11-03 16:54:44 UTC
(
hide
)
Description:
Bug 29409: Check for existence of constraint before deletion
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2021-11-03 16:54:44 UTC
Size:
1.31 KB
patch
obsolete
>From 02d5bba2c52d65b7f8cd60c0133cdcd69ebbaa59 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Wed, 3 Nov 2021 16:51:09 +0000 >Subject: [PATCH] Bug 29409: Check for existence of constraint before deletion > >https://bugs.koha-community.org/show_bug.cgi?id=29049 >--- > installer/data/mysql/updatedatabase.pl | 9 +++++---- > 1 file changed, 5 insertions(+), 4 deletions(-) > >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 40cc2b2248..bf8fc0a946 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -23186,10 +23186,11 @@ $DBversion = '20.06.00.058'; > if( CheckVersion( $DBversion ) ) { > > # Adding the ON DELETE CASCASE ON UPDATE CASCADE, in case it's missing (from 9016 - 3.15.00.039) >- $dbh->do( q{ >- ALTER TABLE letter DROP FOREIGN KEY message_transport_type_fk >- } ); >- >+ if ( foreign_key_exists( 'letter', 'message_transport_type_fk' ) ) { >+ $dbh->do( q{ >+ ALTER TABLE letter DROP FOREIGN KEY message_transport_type_fk >+ } ); >+ } > $dbh->do( q{ > ALTER TABLE letter ADD CONSTRAINT message_transport_type_fk FOREIGN KEY (message_transport_type) REFERENCES message_transport_types(message_transport_type) ON DELETE CASCADE ON UPDATE CASCADE > } ); >-- >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 29409
:
127275
|
127276
|
139931
|
139932
|
140481
|
140482