Koha/installer/data/mysql/db_revs/221200038.pl
Tomas Cohen Arazi c69b7c69ca
Bug 33489: (QA follow-up) Add missing index prefix in DBRev
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-05-17 10:25:11 -03:00

23 lines
911 B
Perl
Executable file

use Modern::Perl;
return {
bug_number => "33489",
description => "Add indices to default patron search fields",
up => sub {
my ($args) = @_;
my ($dbh, $out) = @$args{qw(dbh out)};
# Do you stuffs here
unless ( index_exists( 'borrowers', 'cardnumber_idx' ) ) {
$dbh->do(q{CREATE INDEX cardnumber_idx ON borrowers ( cardnumber )});
say $out "Added new index on borrowers.cardnumber";
}
unless ( index_exists( 'borrowers', 'userid_idx' ) ) {
$dbh->do(q{CREATE INDEX userid_idx ON borrowers ( userid )});
say $out "Added new index on borrowers.userid";
}
unless ( index_exists( 'borrowers', 'middle_name_idx' ) ) {
$dbh->do(q{CREATE INDEX middle_name_idx ON borrowers ( middle_name(768) )});
say $out "Added new index on borrowers.midddle_name";
}
},
};