[Koha-patches] [PATCH] [3.0.x] (bug 4989) add index on guarantorid

Nahuel ANGELINETTI nahuel.angelinetti at biblibre.com
Tue Jul 13 10:54:18 CEST 2010


---
 installer/data/mysql/kohastructure.sql   |    1 +
 installer/data/mysql/updatedatabase30.pl |    7 ++++++-
 2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql
index c4f2558..3759d5c 100644
--- a/installer/data/mysql/kohastructure.sql
+++ b/installer/data/mysql/kohastructure.sql
@@ -493,6 +493,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/updatedatabase30.pl b/installer/data/mysql/updatedatabase30.pl
index 68b2796..c94535a 100644
--- a/installer/data/mysql/updatedatabase30.pl
+++ b/installer/data/mysql/updatedatabase30.pl
@@ -767,7 +767,12 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
     SetVersion ($DBversion);
 }
 
-
+$DBversion = "3.00.06.011";
+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)
 
-- 
1.7.0.4



More information about the Koha-patches mailing list