Bug 7509: Added index on items itemcallnumber
authorIan Walls <koha.sekjal@gmail.com>
Wed, 8 Feb 2012 02:23:39 +0000 (15:23 +1300)
committerPaul Poulain <paul.poulain@biblibre.com>
Fri, 17 Feb 2012 10:29:25 +0000 (11:29 +0100)
Comment from Liz:
I couldn't get this update to fire - I found a small syntax error in the
updatedatabase.pl for this, which I corrected with this patch.

Functionally, all of this works as tested (once the typos were fixed), but
this probably requires another sign-off.

QA notes: rebased on latest master.  Also added index name `itemcallnumber`
to maintain consistency with all other indexes on items table.

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Ian Walls <koha.sekjal@gmail.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
installer/data/mysql/kohastructure.sql
installer/data/mysql/updatedatabase.pl

index 37113c2..67149c9 100644 (file)
@@ -1045,6 +1045,7 @@ CREATE TABLE `items` ( -- holdings/item information
   KEY `itembibnoidx` (`biblionumber`),
   KEY `homebranch` (`homebranch`),
   KEY `holdingbranch` (`holdingbranch`),
+  KEY `itemcallnumber` (`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
index 63ad3d1..9a24afc 100755 (executable)
@@ -4705,6 +4705,13 @@ if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
     SetVersion($DBversion);
 }
 
+$DBversion = "3.07.00.XXX";
+if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
+    $dbh->do("ALTER TABLE items ADD KEY `itemcallnumber` (itemcallnumber)");
+    print "Upgrade to $DBversion done (Added index on items.itemcallnumber)\n";
+    SetVersion($DBversion);
+}
+
 =head1 FUNCTIONS
 
 =head2 DropAllForeignKeys($table)