---
 installer/data/mysql/kohastructure.sql |    1 +
 installer/data/mysql/updatedatabase.pl |    8 ++++++++
 2 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/installer/data/mysql/kohastructure.sql 
b/installer/data/mysql/kohastructure.sql
index 37113c2..34bf1d6 100644
--- a/installer/data/mysql/kohastructure.sql
+++ b/installer/data/mysql/kohastructure.sql
@@ -1045,6 +1045,7 @@ CREATE TABLE `items` ( -- holdings/item information
   KEY `itembibnoidx` (`biblionumber`),
   KEY `homebranch` (`homebranch`),
   KEY `holdingbranch` (`holdingbranch`),
+  KEY (itemcallnumber),
   CONSTRAINT `items_ibfk_1` FOREIGN KEY (`biblioitemnumber`) REFERENCES 
`biblioitems` (`biblioitemnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
   CONSTRAINT `items_ibfk_2` FOREIGN KEY (`homebranch`) REFERENCES `branches` 
(`branchcode`) ON UPDATE CASCADE,
   CONSTRAINT `items_ibfk_3` FOREIGN KEY (`holdingbranch`) REFERENCES 
`branches` (`branchcode`) ON UPDATE CASCADE
diff --git a/installer/data/mysql/updatedatabase.pl 
b/installer/data/mysql/updatedatabase.pl
index 099dfb9..dc79bd9 100755
--- a/installer/data/mysql/updatedatabase.pl
+++ b/installer/data/mysql/updatedatabase.pl
@@ -4663,6 +4663,14 @@ ENDOFRENEWAL
     print "Upgrade to $DBversion done (Added a system preference to allow 
renewal of Patron account either from todays date or from existing expiry date 
in the patrons account.)\n";
     SetVersion($DBversion);
 }
+
+$DBversion = "3.07.00.XXX";
+if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
+    $dbh->do("ALTER TABLE items ADD KEY (itemcallnumber)"
+    print "Upgrade to $DBversion done (Added index on items.itemcallnumber)\n";
+    SetVersion($DBversion);
+}
+
 =head1 FUNCTIONS
 
 =head2 DropAllForeignKeys($table)
-- 
1.6.5

_______________________________________________
Koha-patches mailing list
[email protected]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-patches
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to