From 242f0917fecbdff12b9d4bb3480e3bda8acc3135 Mon Sep 17 00:00:00 2001 From: Fridolin Somers Date: Wed, 25 May 2022 20:32:35 -1000 Subject: [PATCH] Bug 30852: Add index on article_requests.debit_id Signed-off-by: Fridolin Somers --- installer/data/mysql/atomicupdate/bug_30852.pl | 16 ++++++++++++++++ installer/data/mysql/kohastructure.sql | 1 + 2 files changed, 17 insertions(+) create mode 100755 installer/data/mysql/atomicupdate/bug_30852.pl diff --git a/installer/data/mysql/atomicupdate/bug_30852.pl b/installer/data/mysql/atomicupdate/bug_30852.pl new file mode 100755 index 0000000000..c525ab040d --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_30852.pl @@ -0,0 +1,16 @@ +use Modern::Perl; + +return { + bug_number => "30852", + description => "Add index to article_requests.debit_id", + up => sub { + my ($args) = @_; + my ($dbh, $out) = @$args{qw(dbh out)}; + unless ( index_exists( 'article_requests', 'debit_id' ) ) { + $dbh->do(q{ + ALTER TABLE `article_requests` + ADD KEY `debit_id` (`debit_id`) + }); + } + }, +}; diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 852d448804..001ece9f87 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -798,6 +798,7 @@ CREATE TABLE `article_requests` ( KEY `biblionumber` (`biblionumber`), KEY `itemnumber` (`itemnumber`), KEY `branchcode` (`branchcode`), + KEY `debit_id` (`debit_id`), CONSTRAINT `article_requests_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `article_requests_ibfk_2` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `article_requests_ibfk_3` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE SET NULL ON UPDATE CASCADE, -- 2.39.5