Bugzilla – Attachment 181555 Details for
Bug 39618
Add a non-unique index/key to borrowers table for preferred_name
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39618: Add index to borrowers.preferred_name column
Bug-39618-Add-index-to-borrowerspreferredname-colu.patch (text/plain), 2.26 KB, created by
Roman Dolny
on 2025-04-25 20:07:07 UTC
(
hide
)
Description:
Bug 39618: Add index to borrowers.preferred_name column
Filename:
MIME Type:
Creator:
Roman Dolny
Created:
2025-04-25 20:07:07 UTC
Size:
2.26 KB
patch
obsolete
>From 9f670518fb693dbfd247266b3e264f333e18e1fa Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >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 > >Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl> >--- > .../bug_39618_add_preferred_name_key.pl | 21 +++++++++++++++++++ > installer/data/mysql/kohastructure.sql | 1 + > 2 files changed, 22 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 0000000000..f0fc844dcd >--- /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( 'borrowers', 'preferred_name_idx' ) ) { >+ $dbh->do( >+ q{ >+ ALTER TABLE `borrowers` >+ ADD KEY `preferred_name_idx` (`preferred_name`) >+ } >+ ); >+ say_success( $out, "Added index to borrowers.preferred_name" ); >+ } >+ }, >+}; >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index fe7d54cf2d..8078b6cee8 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -1620,6 +1620,7 @@ CREATE TABLE `borrowers` ( > KEY `cardnumber_idx` (`cardnumber`), > KEY `userid_idx` (`userid`), > KEY `middle_name_idx` (`middle_name`(768)), >+ KEY `preferred_name_idx` (`preferred_name`), > CONSTRAINT `borrowers_ibfk_1` FOREIGN KEY (`categorycode`) REFERENCES `categories` (`categorycode`), > CONSTRAINT `borrowers_ibfk_2` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`), > CONSTRAINT `borrowers_ibfk_3` FOREIGN KEY (`sms_provider_id`) REFERENCES `sms_providers` (`id`) ON DELETE SET NULL ON UPDATE CASCADE >-- >2.39.5
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 39618
:
180887
|
180926
|
181528
|
181555
|
181872