Koha/installer/data/mysql/db_revs/221200038.pl
Tomas Cohen Arazi 6a84d74102
Bug 33489: DBRev 22.12.00.038
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-05-12 17:50:04 -03:00

23 lines
906 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 )});
say $out "Added new index on borrowers.midddle_name";
}
},
};