diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index abad5c876a..5b55b131aa 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -271,6 +271,9 @@ CREATE TABLE `borrowers` ( -- this table includes information about your patrons KEY `branchcode` (`branchcode`), KEY `userid` (`userid`), KEY `guarantorid` (`guarantorid`), + KEY `surname_idx` (`surname`(255)), + KEY `firstname_idx` (`firstname`(255)), + KEY `othernames_idx` (`othernames`(255)), CONSTRAINT `borrowers_ibfk_1` FOREIGN KEY (`categorycode`) REFERENCES `categories` (`categorycode`), CONSTRAINT `borrowers_ibfk_2` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 791e4d355f..7d302bd412 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -7864,6 +7864,18 @@ if ( CheckVersion($DBversion) ) { SetVersion ($DBversion); } +$DBversion = "3.15.00.XXX"; +if(CheckVersion($DBversion)) { + $dbh->do(q{ + ALTER TABLE `borrowers` + ADD KEY `surname_idx` (`surname`(255)), + ADD KEY `firstname_idx` (`firstname`(255)), + ADD KEY `othernames_idx` (`othernames`(255)) + }); + print "Upgrade to $DBversion done (Bug 11249 - Add db indexes on borrowers names)\n"; + SetVersion($DBversion); +} + =head1 FUNCTIONS =head2 TableExists($table)