Bugzilla – Attachment 120219 Details for
Bug 17202
Deleting a rotating collection with items should either be prohibited or items should be removed
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17202: (follow-up) Conditionally add FK
Bug-17202-follow-up-Conditionally-add-FK.patch (text/plain), 1.56 KB, created by
Nick Clemens (kidclamp)
on 2021-04-27 12:54:10 UTC
(
hide
)
Description:
Bug 17202: (follow-up) Conditionally add FK
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2021-04-27 12:54:10 UTC
Size:
1.56 KB
patch
obsolete
>From 19f273f26bb48e38b5d4c4132dbdc9747944cf3c Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Tue, 27 Apr 2021 12:52:26 +0000 >Subject: [PATCH] Bug 17202: (follow-up) Conditionally add FK > >--- > installer/data/mysql/atomicupdate/bug_17202.perl | 16 +++++++++------- > 1 file changed, 9 insertions(+), 7 deletions(-) > >diff --git a/installer/data/mysql/atomicupdate/bug_17202.perl b/installer/data/mysql/atomicupdate/bug_17202.perl >index f0ddb49f64..85f3f41325 100644 >--- a/installer/data/mysql/atomicupdate/bug_17202.perl >+++ b/installer/data/mysql/atomicupdate/bug_17202.perl >@@ -1,12 +1,14 @@ > $DBversion = 'XXX'; # will be replaced by the RM > if( CheckVersion( $DBversion ) ) { >- $dbh->do(q{ >- DELETE FROM collections_tracking WHERE colId NOT IN ( SELECT colId FROM collections ) >- }); >- $dbh->do(q{ >- ALTER TABLE collections_tracking >- ADD CONSTRAINT `collectionst_ibfk_1` FOREIGN KEY (`colId`) REFERENCES `collections` (`colId`) ON DELETE CASCADE ON UPDATE CASCADE >- }); >+ unless( foreign_key_exists( 'collections_tracking', 'collectionst_ibfk_1' ) ) { >+ $dbh->do(q{ >+ DELETE FROM collections_tracking WHERE colId NOT IN ( SELECT colId FROM collections ) >+ }); >+ $dbh->do(q{ >+ ALTER TABLE collections_tracking >+ ADD CONSTRAINT `collectionst_ibfk_1` FOREIGN KEY (`colId`) REFERENCES `collections` (`colId`) ON DELETE CASCADE ON UPDATE CASCADE >+ }); >+ } > > NewVersion( $DBversion, 17202, "Add FK constraint for collection to collections_tracking"); > } >-- >2.11.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 17202
:
119306
|
119330
|
120099
|
120100
|
120216
|
120217
|
120218
| 120219