From a72c8d07a5323958fb87eb0609b8070359d7944b Mon Sep 17 00:00:00 2001 From: Nahuel ANGELINETTI Date: Tue, 13 Jul 2010 10:56:12 +0200 Subject: [PATCH] (bug 4989) add index on guarantorid Signed-off-by: Galen Charlton --- installer/data/mysql/kohastructure.sql | 1 + installer/data/mysql/updatedatabase.pl | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index e42cecd475..e42652c486 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -262,6 +262,7 @@ CREATE TABLE `borrowers` ( KEY `categorycode` (`categorycode`), KEY `branchcode` (`branchcode`), KEY `userid` (`userid`), + KEY `guarantorid` (`guarantorid`), 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 6560aed41a..065ad821b0 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -3694,7 +3694,12 @@ if (C4::Context->preference('Version') < TransformToNum($DBversion)){ SetVersion ($DBversion); } - +$DBversion = "3.02.00.025"; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do("ALTER TABLE borrowers ADD KEY `guarantorid` (guarantorid);"); + print "Upgrade to $DBversion done (Add index on guarantorid)\n"; + SetVersion ($DBversion); +} =item DropAllForeignKeys($table) Drop all foreign keys of the table $table -- 2.39.5