From 67e8530a990095f6159ba90223964995c08f40ad Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Fri, 11 Apr 2025 20:41:17 +0000 Subject: [PATCH] Bug 39618: Add index to borrowers.preferred_name column To test: 1. APPLY PATCH 2. updatedatabase --- .../bug_39618_add_preferred_name_key.pl | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 installer/data/mysql/atomicupdate/bug_39618_add_preferred_name_key.pl diff --git a/installer/data/mysql/atomicupdate/bug_39618_add_preferred_name_key.pl b/installer/data/mysql/atomicupdate/bug_39618_add_preferred_name_key.pl new file mode 100755 index 00000000000..564c788af17 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_39618_add_preferred_name_key.pl @@ -0,0 +1,21 @@ +use Modern::Perl; +use Koha::Installer::Output qw(say_warning say_success say_info); + +return { + bug_number => "39618", + description => "Add index to borrowers.preferred_name", + up => sub { + my ($args) = @_; + my ( $dbh, $out ) = @$args{qw(dbh out)}; + + unless ( index_exists( 'article_requests', 'debit_id' ) ) { + $dbh->do( + q{ + ALTER TABLE `borrowers` + ADD KEY `preferred_name` (`preferred_name`) + } + ); + } + say_success( $out, "Added index to borrowers.preferred_name" ); + }, +}; -- 2.39.5