Bugzilla – Attachment 139932 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 data that violates a constraint to avoid update problems
Bug-29409-Check-for-data-that-violates-a-constrain.patch (text/plain), 1.53 KB, created by
Joonas Kylmälä
on 2022-08-28 17:51:06 UTC
(
hide
)
Description:
Bug 29409: Check for data that violates a constraint to avoid update problems
Filename:
MIME Type:
Creator:
Joonas Kylmälä
Created:
2022-08-28 17:51:06 UTC
Size:
1.53 KB
patch
obsolete
>From 9ad4a8e0511e898fc653476f13d23cafe9ffb7e9 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Wed, 3 Nov 2021 16:53:47 +0000 >Subject: [PATCH] Bug 29409: Check for data that violates a constraint to avoid > update problems >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >https://bugs.koha-community.org/show_bug.cgi?id=29049 > >Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi> >--- > installer/data/mysql/updatedatabase.pl | 5 +++++ > 1 file changed, 5 insertions(+) > >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 8a02ead757..7d204787c9 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -23195,6 +23195,11 @@ if( CheckVersion( $DBversion ) ) { > 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 > } ); > >+ # Foreign keys should prevent this, however, it has been found in many production databases >+ $dbh->do( q{ >+ DELETE borrower_message_transport_preferences FROM borrower_message_transport_preferences LEFT JOIN borrower_message_preferences USING (borrower_message_preference_id) WHERE borrower_message_preferences.borrower_message_preference_id IS NULL >+ } ); >+ > $dbh->do(q{ > UPDATE message_transport_types SET message_transport_type = "itiva" WHERE message_transport_type = "phone" > }); >-- >2.30.2
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