Bugzilla – Attachment 174188 Details for
Bug 38011
Add a foreign key link between vendors and subscriptions
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38011: (QA follow-up) Improve database update
Bug-38011-QA-follow-up-Improve-database-update.patch (text/plain), 1.99 KB, created by
Jonathan Druart
on 2024-11-07 12:42:03 UTC
(
hide
)
Description:
Bug 38011: (QA follow-up) Improve database update
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2024-11-07 12:42:03 UTC
Size:
1.99 KB
patch
obsolete
>From d6d7ef539d962b544c843263cdf1275875c0e419 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Thu, 7 Nov 2024 11:27:42 +0000 >Subject: [PATCH] Bug 38011: (QA follow-up) Improve database update > >This patch ensure's we fix errant values in subscriptions prior to >adding the foreign key constraint. > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > .../bug_38011-add_fk_to_subscriptions.pl | 14 ++++++++++++-- > 1 file changed, 12 insertions(+), 2 deletions(-) > >diff --git a/installer/data/mysql/atomicupdate/bug_38011-add_fk_to_subscriptions.pl b/installer/data/mysql/atomicupdate/bug_38011-add_fk_to_subscriptions.pl >index 3e23724b921..5b869213e1c 100755 >--- a/installer/data/mysql/atomicupdate/bug_38011-add_fk_to_subscriptions.pl >+++ b/installer/data/mysql/atomicupdate/bug_38011-add_fk_to_subscriptions.pl >@@ -16,6 +16,16 @@ return { > } > ); > >+ my $fixed = $dbh->do( >+ q{ >+ UPDATE subscription SET aqbooksellerid = NULL WHERE aqbooksellerid NOT IN (SELECT id FROM aqbooksellers) >+ } >+ ); >+ say_info( >+ $out, >+ "Updated $fixed subscriptions with NULL aqbooksellersid where aqbooksellerid was not found in aqbooksellers" >+ ) if $fixed; >+ > $dbh->do( > q| > ALTER TABLE subscription >@@ -24,9 +34,9 @@ return { > REFERENCES aqbooksellers (id) ON DELETE SET NULL ON UPDATE CASCADE > | > ); >- say_success( $out, "Updated foreign key 'subscription_ibfk_4'" ); >+ say_success( $out, "Added new foreign key 'subscription_ibfk_4'" ); > } else { >- say_warning( $out, "Foreign key 'subscription_ibfk_4' already exists" ); >+ say_info( $out, "Foreign key 'subscription_ibfk_4' already exists" ); > } > }, > }; >-- >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 38011
:
171971
|
171972
|
173859
|
173860
|
174180
|
174181
|
174182
|
174183
|
174185
|
174186
|
174187
| 174188 |
174397
|
174492