Bugzilla – Attachment 127848 Details for
Bug 29341
If OpacRenewalBranch = opacrenew, pseudonymization process leads to "internal server error" when patrons renew the loans at OPAC
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29341: Remove foreign keys on pseudonymized_transactions
Bug-29341-Remove-foreign-keys-on-pseudonymizedtran.patch (text/plain), 2.64 KB, created by
Marcel de Rooy
on 2021-11-19 09:08:56 UTC
(
hide
)
Description:
Bug 29341: Remove foreign keys on pseudonymized_transactions
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2021-11-19 09:08:56 UTC
Size:
2.64 KB
patch
obsolete
>From 8ea3d8775c6ed3c5f40bbdaf044a0971794c94db Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 17 Nov 2021 12:25:35 +0100 >Subject: [PATCH] Bug 29341: Remove foreign keys on pseudonymized_transactions >Content-Type: text/plain; charset=utf-8 > >Behave like the statistics table and don't remove the code even if the >branch or patron's category is removed. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > installer/data/mysql/atomicupdate/bug_29394.pl | 17 +++++++++++++++++ > installer/data/mysql/kohastructure.sql | 5 +---- > 2 files changed, 18 insertions(+), 4 deletions(-) > create mode 100755 installer/data/mysql/atomicupdate/bug_29394.pl > >diff --git a/installer/data/mysql/atomicupdate/bug_29394.pl b/installer/data/mysql/atomicupdate/bug_29394.pl >new file mode 100755 >index 0000000000..d9abc04b9c >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_29394.pl >@@ -0,0 +1,17 @@ >+use Modern::Perl; >+ >+return { >+ bug_number => "29341", >+ description => "Remove foreign keys on pseudonymized_transactions", >+ up => sub { >+ my ($args) = @_; >+ my ($dbh, $out) = @$args{qw(dbh out)}; >+ for my $fk ( qw( pseudonymized_transactions_borrowers_ibfk_2 pseudonymized_transactions_borrowers_ibfk_3 pseudonymized_transactions_ibfk_1 ) ) { >+ if ( foreign_key_exists( 'pseudonymized_transactions', $fk ) ) { >+ $dbh->do(qq{ >+ ALTER TABLE pseudonymized_transactions DROP FOREIGN KEY $fk >+ }); >+ } >+ } >+ }, >+} >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index ccf99df9e0..d5768b9e9c 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -4230,10 +4230,7 @@ CREATE TABLE `pseudonymized_transactions` ( > PRIMARY KEY (`id`), > KEY `pseudonymized_transactions_ibfk_1` (`categorycode`), > KEY `pseudonymized_transactions_borrowers_ibfk_2` (`branchcode`), >- KEY `pseudonymized_transactions_borrowers_ibfk_3` (`transaction_branchcode`), >- CONSTRAINT `pseudonymized_transactions_borrowers_ibfk_2` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`), >- CONSTRAINT `pseudonymized_transactions_borrowers_ibfk_3` FOREIGN KEY (`transaction_branchcode`) REFERENCES `branches` (`branchcode`), >- CONSTRAINT `pseudonymized_transactions_ibfk_1` FOREIGN KEY (`categorycode`) REFERENCES `categories` (`categorycode`) >+ KEY `pseudonymized_transactions_borrowers_ibfk_3` (`transaction_branchcode`) > ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; > /*!40101 SET character_set_client = @saved_cs_client */; > >-- >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 29341
:
127034
|
127078
|
127213
|
127350
|
127727
| 127848