Adding index on userid in the borrowers table

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
This commit is contained in:
Chris Cormack 2007-10-19 00:28:03 -05:00 committed by Joshua Ferraro
parent 6f15e48f65
commit 9344d266c7
3 changed files with 11 additions and 1 deletions

View File

@ -478,6 +478,7 @@ CREATE TABLE `borrowers` (
KEY `borrowernumber` (`borrowernumber`),
KEY `categorycode` (`categorycode`),
KEY `branchcode` (`branchcode`),
KEY `userid` (`userid`),
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;

View File

@ -8,7 +8,7 @@
# and is automatically called by Auth.pm when needed.
sub kohaversion {
return "3.00.00.009";
return "3.00.00.010";
}
1;

View File

@ -283,6 +283,15 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
SetVersion ($DBversion);
}
$DBversion = "3.00.00.010";
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
$dbh->do("CREATE INDEX `userid` ON borrowers (`userid`) ");
print "Upgrade to $DBversion done (userid index added)\n";
SetVersion ($DBversion);
}
=item DropAllForeignKeys($table)
Drop all foreign keys of the table $table