Bugzilla – Attachment 174183 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.91 KB, created by
Martin Renvoize (ashimema)
on 2024-11-07 12:10:27 UTC
(
hide
)
Description:
Bug 38011: (QA follow-up) Improve database update
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-11-07 12:10:27 UTC
Size:
1.91 KB
patch
obsolete
>From 4ddcd9f5652b52d335c66525e92bbfc3d60eff29 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> >--- > .../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.47.0
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