Bugzilla – Attachment 130753 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]
[21.05.x] Bug 29495: Drop issue_id constraint from return_claims
2105x-Bug-29495-Drop-issueid-constraint-from-retur.patch (text/plain), 2.55 KB, created by
Tomás Cohen Arazi (tcohen)
on 2022-02-17 15:23:08 UTC
(
hide
)
Description:
[21.05.x] Bug 29495: Drop issue_id constraint from return_claims
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2022-02-17 15:23:08 UTC
Size:
2.55 KB
patch
obsolete
>From 5f0d8d9b690b515011f4586242a0d89864957832 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] [21.05.x] 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. > >Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > installer/data/mysql/atomicupdate/bug_29495.perl | 10 ++++++++++ > installer/data/mysql/kohastructure.sql | 1 - > 2 files changed, 10 insertions(+), 1 deletion(-) > create mode 100644 installer/data/mysql/atomicupdate/bug_29495.perl > >diff --git a/installer/data/mysql/atomicupdate/bug_29495.perl b/installer/data/mysql/atomicupdate/bug_29495.perl >new file mode 100644 >index 0000000000..1ba2e5ecd3 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_29495.perl >@@ -0,0 +1,10 @@ >+$DBversion = 'XXX'; # will be replaced by the RM >+if( CheckVersion( $DBversion ) ) { >+ if ( foreign_key_exists( 'return_claims', 'issue_id' ) ) { >+ $dbh->do(q{ >+ ALTER TABLE return_claims DROP FOREIGN KEY issue_id >+ }); >+ } >+ >+ NewVersion( $DBversion, 29495, "Issue link is lost in return claims when using 'MarkLostItemsAsReturned'"); >+} >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index e5e350f568..b47fc4493d 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -4364,7 +4364,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.32.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 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