Bugzilla – Attachment 127765 Details for
Bug 29495
Issue link is lost in return claims when using 'MarkLostItemsAsReturned'
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29495: Drop issue_id constraint from return_claims
Bug-29495-Drop-issueid-constraint-from-returnclaim.patch (text/plain), 2.46 KB, created by
Martin Renvoize (ashimema)
on 2021-11-18 07:45:06 UTC
(
hide
)
Description:
Bug 29495: Drop issue_id constraint from return_claims
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2021-11-18 07:45:06 UTC
Size:
2.46 KB
patch
obsolete
>From cfd19cbe7dc6b0107fb4317aac0d86028ebd7bb7 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Wed, 17 Nov 2021 09:56:48 +0000 >Subject: [PATCH] Bug 29495: Drop issue_id constraint from return_claims > >This patch removes the issue_id constraint from return_claims. > >Due to the nature of our dual table approach to checkouts/old_checkouts >we can't safely hae this constraint and not lose data. Prior to this >commit, when an item is checked in we move the checkout from checkouts >to old_checkouts.. this therefore triggers the delete of the issue_id >from the return_claims table as described by the foreign key constraint. >--- > installer/data/mysql/atomicupdate/bug_29495.pl | 15 +++++++++++++++ > installer/data/mysql/kohastructure.sql | 1 - > 2 files changed, 15 insertions(+), 1 deletion(-) > create mode 100644 installer/data/mysql/atomicupdate/bug_29495.pl > >diff --git a/installer/data/mysql/atomicupdate/bug_29495.pl b/installer/data/mysql/atomicupdate/bug_29495.pl >new file mode 100644 >index 0000000000..b492b8597f >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_29495.pl >@@ -0,0 +1,15 @@ >+use Modern::Perl; >+ >+return { >+ bug_number => "29495", >+ description => "Drop issue_id contraint from return_claims table", >+ up => sub { >+ my ($args) = @_; >+ my ($dbh, $out) = @$args{qw(dbh out)}; >+ if ( foreign_key_exists( 'return_claims', 'issue_id' ) ) { >+ $dbh->do(q{ >+ ALTER TABLE return_claims DROP FOREIGN KEY issue_id >+ }); >+ } >+ }, >+} >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index ccf99df9e0..038cf0267d 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -4388,7 +4388,6 @@ CREATE TABLE `return_claims` ( > KEY `rc_created_by_ibfk` (`created_by`), > KEY `rc_updated_by_ibfk` (`updated_by`), > KEY `rc_resolved_by_ibfk` (`resolved_by`), >- CONSTRAINT `issue_id` FOREIGN KEY (`issue_id`) REFERENCES `issues` (`issue_id`) ON DELETE SET NULL ON UPDATE CASCADE, > CONSTRAINT `rc_borrowers_ibfk` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE, > CONSTRAINT `rc_created_by_ibfk` FOREIGN KEY (`created_by`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE, > CONSTRAINT `rc_items_ibfk` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) 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 29495
:
127711
|
127712
|
127713
|
127714
|
127765
|
127766
|
127767
|
127768
|
127769
|
127809
|
127810
|
127811
|
127812
|
127813
|
127937
|
127938
|
127939
|
127940
|
127941
|
127942
|
127943
|
127944
|
129105
|
129106
|
129107
|
129109
|
129110
|
129111
|
129112
|
129113
|
129547
|
129575
|
129582
|
130460
|
130461
|
130462
|
130463
|
130464
|
130465
|
130466
|
130467
|
130752
|
130753
|
130754
|
130755
|
130756
|
130757
|
130758