X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=installer%2Fdata%2Fmysql%2Fupdatedatabase.pl;h=68e7cbcf4f90c662493a9a463c010c1363561811;hb=17800939e8a3e6f34549ade0e5e068728e5cb907;hp=8d65a4b1360a37dcfdfb593ed114627ee9506da3;hpb=411aae1a87c7b83c93104deb00061d1a04fbb265;p=koha_fer diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 8d65a4b136..68e7cbcf4f 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -2726,7 +2726,7 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { $DBversion = '3.01.00.066'; if (C4::Context->preference("Version") < TransformToNum($DBversion)) { $dbh->do('ALTER TABLE issuingrules ADD COLUMN `reservesallowed` smallint(6) NOT NULL default "0" AFTER `renewalsallowed`;'); - + my $maxreserves = C4::Context->preference('maxreserves'); $sth = $dbh->prepare('UPDATE issuingrules SET reservesallowed = ?;'); $sth->execute($maxreserves); @@ -2744,12 +2744,14 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { $dbh->do("INSERT INTO permissions (module_bit, code, description) VALUES ( 13, 'batchmod', 'Perform batch modification of items')"); $dbh->do("INSERT INTO permissions (module_bit, code, description) VALUES ( 13, 'batchdel', 'Perform batch deletion of items')"); print "Upgrade to $DBversion done (added permissions for batch modification and deletion)\n"; + SetVersion ($DBversion); } $DBversion = "3.01.00.068"; if (C4::Context->preference("Version") < TransformToNum($DBversion)) { $dbh->do("ALTER TABLE issuingrules ADD COLUMN `finedays` int(11) default NULL AFTER `fine` "); print "Upgrade done (Adding finedays in issuingrules table)\n"; + SetVersion ($DBversion); } @@ -2865,13 +2867,15 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { ) ENGINE=InnoDB DEFAULT CHARSET=utf8;"); $dbh->do("ALTER TABLE aqbasket ADD COLUMN `basketgroupid` int(11)"); $dbh->do("ALTER TABLE aqbasket ADD FOREIGN KEY (`basketgroupid`) REFERENCES `aqbasketgroups` (`id`) ON UPDATE CASCADE ON DELETE SET NULL"); - $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('pdfformat','pdfformat::example','Controls what script is used for printing (basketgroups)','','free')"); + $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('pdfformat','pdfformat::layout2pages','Controls what script is used for printing (basketgroups)','','free')"); print "Upgrade to $DBversion done (adding basketgroups)\n"; SetVersion ($DBversion); } $DBversion = '3.01.00.077'; if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + + $dbh->do("SET FOREIGN_KEY_CHECKS=0 "); $dbh->do("DROP TABLE IF EXISTS `aqbudgetperiods` "); $dbh->do(qq| CREATE TABLE `aqbudgetperiods` ( @@ -2888,7 +2892,7 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { $dbh->do(< AQBUDGETS IMPORT JUST YET, # BUT A NEW CLEAN AQBUDGETS TABLE CREATE FOR NOW.. @@ -2904,16 +2908,19 @@ ADDPERIODS #$dbh->do("drop table aqbudget;"); - $dbh->do(<selectcol_arrayref(<selectcol_arrayref(<do(<do(<do(<do(<do("DROP TABLE aqbookfund "); $dbh->do("DROP TABLE IF EXISTS `aqbudgets_planning` "); $dbh->do("CREATE TABLE `aqbudgets_planning` ( @@ -2991,10 +2996,11 @@ BUDGETDROPDATES ADD COLUMN `sort1_authcat` varchar(10) default NULL, ADD COLUMN `sort2_authcat` varchar(10) default NULL" ); - - + # cannot do until aqorderbreakdown removed +# $dbh->do("DROP TABLE aqbookfund "); # $dbh->do("ALTER TABLE aqorders ADD FOREIGN KEY (`budget_id`) REFERENCES `aqbudgets` (`budget_id`) ON UPDATE CASCADE " ); ???? + $dbh->do("SET FOREIGN_KEY_CHECKS=1 "); print "Upgrade to $DBversion done (Adding new aqbudgetperiods, aqbudgets and aqbudget_planning tables )\n"; SetVersion ($DBversion); @@ -3074,6 +3080,7 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { ); $dbh->do(qq| DROP TABLE aqorderbreakdown |); + $dbh->do('DROP TABLE aqbookfund'); print "Upgrade to $DBversion done (New aqorders_items table for acqui)\n"; SetVersion ($DBversion); } @@ -3337,7 +3344,7 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { $dbh->do(" INSERT INTO permissions (module_bit, code, description) VALUES ( 13, 'rotating_collections', 'Manage Rotating collections')" ); - print "Upgrade to $DBversion done (added collection and collection_tracking tables for rotataing collection functionnality)\n"; + print "Upgrade to $DBversion done (added collection and collection_tracking tables for rotating collections functionality)\n"; SetVersion ($DBversion); } $DBversion = "3.01.00.106"; @@ -3355,6 +3362,332 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion ($DBversion); } +$DBversion = '3.01.00.108'; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do(qq{ + ALTER TABLE `export_format` ADD `csv_separator` VARCHAR( 2 ) NOT NULL AFTER `marcfields` , + ADD `field_separator` VARCHAR( 2 ) NOT NULL AFTER `csv_separator` , + ADD `subfield_separator` VARCHAR( 2 ) NOT NULL AFTER `field_separator` + }); + print "Upgrade done (added separators for csv export)\n"; + SetVersion ($DBversion); +} + +$DBversion = "3.01.00.109"; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do(qq{ + ALTER TABLE `export_format` ADD `encoding` VARCHAR(255) NOT NULL AFTER `subfield_separator` + }); + print "Upgrade done (added encoding for csv export)\n"; + SetVersion ($DBversion); +} + +$DBversion = '3.01.00.110'; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do('ALTER TABLE `categories` ADD COLUMN `enrolmentperioddate` DATE NULL DEFAULT NULL AFTER `enrolmentperiod`'); + print "Upgrade done (Add enrolment period date support)\n"; + SetVersion ($DBversion); +} + +$DBversion = '3.01.00.111'; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + print "Upgrade done (mark DBrev for 3.2-alpha release)\n"; + SetVersion ($DBversion); +} + +$DBversion = '3.01.00.112'; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do("INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES ('SpineLabelShowPrintOnBibDetails', '0', '', 'If turned on, a \"Print Label\" link will appear for each item on the bib details page in the staff interface.', 'YesNo');"); + print "Upgrade done ( added Show Spine Label Printer on Bib Items Details preferences )\n"; + SetVersion ($DBversion); +} + +$DBversion = '3.01.00.113'; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + my $value = C4::Context->preference("XSLTResultsDisplay"); + $dbh->do( + "INSERT INTO systempreferences (variable,value,type) + VALUES('OPACXSLTResultsDisplay',$value,'YesNo')"); + $value = C4::Context->preference("XSLTDetailsDisplay"); + $dbh->do( + "INSERT INTO systempreferences (variable,value,type) + VALUES('OPACXSLTDetailsDisplay',$value,'YesNo')"); + print "Upgrade done (added two new syspref: OPACXSLTResultsDisplay and OPACXSLTDetailDisplay). You may have to go in Admin > System preference to tweak XSLT related syspref both in OPAC and Search tabs.\n "; + SetVersion ($DBversion); +} + +$DBversion = '3.01.00.114'; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type)VALUES('AutoSelfCheckAllowed', '0', 'For corporate and special libraries which want web-based self-check available from any PC without the need for a manual staff login. Most libraries will want to leave this turned off. If on, requires self-check ID and password to be entered in AutoSelfCheckID and AutoSelfCheckPass sysprefs.', '', 'YesNo')"); + $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AutoSelfCheckID','','Staff ID with circulation rights to be used for automatic web-based self-check. Only applies if AutoSelfCheckAllowed syspref is turned on.','','free')"); + $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AutoSelfCheckPass','','Password to be used for automatic web-based self-check. Only applies if AutoSelfCheckAllowed syspref is turned on.','','free')"); + print "Upgrade to $DBversion done ( Added AutoSelfCheckAllowed, AutoSelfCheckID, and AutoShelfCheckPass system preference )\n"; + SetVersion ($DBversion); +} + +$DBversion = '3.01.00.115'; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do('UPDATE aqorders SET quantityreceived = 0 WHERE quantityreceived IS NULL'); + $dbh->do('ALTER TABLE aqorders MODIFY COLUMN quantityreceived smallint(6) NOT NULL DEFAULT 0'); + print "Upgrade to $DBversion done ( Default aqorders.quantityreceived to 0 )\n"; + SetVersion ($DBversion); +} + +$DBversion = '3.01.00.116'; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + if (C4::Context->preference('OrderPdfFormat') eq 'pdfformat::example'){ + $dbh->do("UPDATE `systempreferences` set value='pdfformat::layout2pages' WHERE variable='OrderPdfFormat'"); + } + print "Upgrade done ( corrected default OrderPdfFormat value if still set wrong )\n"; + SetVersion ($DBversion); +} + +$DBversion = '3.01.00.117'; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do("UPDATE language_rfc4646_to_iso639 SET iso639_2_code = 'por' WHERE rfc4646_subtag='pt' "); + print "Upgrade to $DBversion done (corrected ISO 639-2 language code for Portuguese)\n"; + SetVersion ($DBversion); +} + +$DBversion = '3.01.00.118'; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + my ($count) = $dbh->selectrow_array("SELECT count(*) FROM information_schema.columns + WHERE table_name = 'aqbudgets_planning' + AND column_name = 'display'"); + if ($count < 1) { + $dbh->do("ALTER TABLE aqbudgets_planning ADD COLUMN display tinyint(1) DEFAULT 1"); + } + print "Upgrade to $DBversion done (bug 4203: add display column to aqbudgets_planning if missing)\n"; + SetVersion ($DBversion); +} + +$DBversion = '3.01.00.119'; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + eval{require Locale::Currency::Format}; + if (!$@) { + print "Upgrade to $DBversion done (Locale::Currency::Format installed.)\n"; + SetVersion ($DBversion); + } + else { + print "Upgrade to $DBversion done.\n"; + print "NOTICE: The Locale::Currency::Format package is not installed on your system or not found in \@INC.\nThis dependency is required in order to include fine information in overdue notices.\nPlease ask your system administrator to install this package.\n"; + SetVersion ($DBversion); + } +} + +$DBversion = '3.01.00.120'; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do(q{ +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('soundon','0','Enable circulation sounds during checkin and checkout in the staff interface. Not supported by all web browsers yet.','','YesNo'); +}); + print "Upgrade to $DBversion done (bug 1080: add soundon system preference for circulation sounds)\n"; + SetVersion ($DBversion); +} + +$DBversion = '3.01.00.121'; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do("ALTER TABLE `reserves` ADD `expirationdate` DATE DEFAULT NULL"); + $dbh->do("ALTER TABLE `reserves` ADD `lowestPriority` tinyint(1) NOT NULL"); + $dbh->do("ALTER TABLE `old_reserves` ADD `expirationdate` DATE DEFAULT NULL"); + $dbh->do("ALTER TABLE `old_reserves` ADD `lowestPriority` tinyint(1) NOT NULL"); + print "Upgrade to $DBversion done ( Added Additional Fields to Reserves tables )\n"; + SetVersion ($DBversion); +} + +$DBversion = '3.01.00.122'; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do(q{ + INSERT INTO systempreferences (variable,value,explanation,options,type) + VALUES ('OAI-PMH:ConfFile', '', 'If empty, Koha OAI Server operates in normal mode, otherwise it operates in extended mode.','','File'); +}); + print "Upgrade to $DBversion done. — Add a new system preference OAI-PMF:ConfFile\n"; + SetVersion ($DBversion); +} + +$DBversion = "3.01.00.123"; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do("INSERT INTO `permissions` (`module_bit`, `code`, `description`) VALUES + (6, 'place_holds', 'Place holds for patrons')"); + $dbh->do("INSERT INTO `permissions` (`module_bit`, `code`, `description`) VALUES + (6, 'modify_holds_priority', 'Modify holds priority')"); + $dbh->do("UPDATE `userflags` SET `flagdesc` = 'Place and modify holds for patrons' WHERE `flag` = 'reserveforothers'"); + print "Upgrade to $DBversion done (Add granular permission for holds modification and update description of reserveforothers permission)\n"; + SetVersion ($DBversion); +} + +$DBversion = '3.01.00.124'; +if (C4::Context->preference('Version') < TransformToNum($DBversion)){ + $dbh->do(" + INSERT INTO `letter` (module, code, name, title, content) VALUES('reserves', 'HOLDPLACED', 'Hold Placed on Item', 'Hold Placed on Item','A hold has been placed on the following item : <> (<<biblionumber>>) by the user <<firstname>> <<surname>> (<<cardnumber>>).'); + "); + print "Upgrade to $DBversion done (bug 3242: add HOLDPLACED letter template, which is used when emailLibrarianWhenHoldIsPlaced is enabled)\n"; + SetVersion ($DBversion); +} + +$DBversion = '3.01.00.125'; +if (C4::Context->preference('Version') < TransformToNum($DBversion)){ + $dbh->do(" + INSERT INTO `systempreferences` ( `variable` , `value` , `options` , `explanation` , `type` ) VALUES ( 'PrintNoticesMaxLines', '0', '', 'If greater than 0, sets the maximum number of lines an overdue notice will print. If the number of items is greater than this number, the notice will end with a warning asking the borrower to check their online account for a full list of overdue items.', 'Integer' ); + "); + $dbh->do(" + INSERT INTO message_transport_types (message_transport_type) values ('print'); + "); + print "Upgrade to $DBversion done (bug 3482: Printable hold and overdue notices)\n"; + SetVersion ($DBversion); +} + +$DBversion = "3.01.00.126"; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ILS-DI','0','Enable ILS-DI services. See http://your.opac.name/cgi-bin/koha/ilsdi.pl for online documentation.','','YesNo')"); + $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ILS-DI:AuthorizedIPs','127.0.0.1','A comma separated list of IP addresses authorized to access the web services.','','free')"); + + print "Upgrade to $DBversion done (Adding ILS-DI updates and ILS-DI:Authorized_IPs)\n"; + SetVersion ($DBversion); +} + +$DBversion = '3.01.00.127'; +if (C4::Context->preference('Version') < TransformToNum($DBversion)){ + $dbh->do("ALTER TABLE messages CHANGE branchcode branchcode varchar(10);"); + print "Upgrade to $DBversion done (bug 4190: messages in patron account did not work with branchcodes > 4)\n"; + SetVersion ($DBversion); +} + +$DBversion = '3.01.00.128'; +if (C4::Context->preference('Version') < TransformToNum($DBversion)){ + $dbh->do('CREATE INDEX budget_id ON aqorders (budget_id );'); + print "Upgrade to $DBversion done (bug 4331: index orders by budget_id)\n"; + SetVersion ($DBversion); +} + +$DBversion = "3.01.00.129"; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do("UPDATE `permissions` SET `code` = 'items_batchdel' WHERE `permissions`.`module_bit` =13 AND `permissions`.`code` = 'batchdel' LIMIT 1 ;"); + $dbh->do("UPDATE `permissions` SET `code` = 'items_batchmod' WHERE `permissions`.`module_bit` =13 AND `permissions`.`code` = 'batchmod' LIMIT 1 ;"); + print "Upgrade done (Change permissions names for item batch modification / deletion)\n"; + + SetVersion ($DBversion); +} + +$DBversion = "3.01.00.130"; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do("UPDATE reserves SET expirationdate = NULL WHERE expirationdate = '0000-00-00'"); + print "Upgrade done (change reserves.expirationdate values of 0000-00-00 to NULL (bug 1532)"; + SetVersion ($DBversion); +} + +$DBversion = "3.01.00.131"; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do(q{ +INSERT IGNORE INTO message_transport_types (message_transport_type) VALUES ('print'),('feed'); + }); + print "Upgrade to $DBversion done (adding print and feed message transport types)\n"; + SetVersion ($DBversion); +} + +$DBversion = "3.01.00.132"; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do(q{ + ALTER TABLE language_descriptions ADD INDEX subtag_type_lang (subtag, type, lang); + }); + print "Upgrade to $DBversion done (Adding index to language_descriptions table)\n"; + SetVersion ($DBversion); +} + +$DBversion = '3.01.00.133'; +if (C4::Context->preference('Version') < TransformToNum($DBversion)){ + $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('OverduesBlockCirc','noblock','When checking out an item should overdues block checkout, generate a confirmation dialogue, or allow checkout','noblock|confirmation|block','Choice')"); + print "Upgrade to $DBversion done (bug 4405: added OverduesBlockCirc syspref to control whether circulation is blocked if a borrower has overdues)\n"; + SetVersion ($DBversion); +} + +$DBversion = '3.01.00.134'; +if (C4::Context->preference('Version') < TransformToNum($DBversion)){ + $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('DisplayMultiPlaceHold','1','Display the ability to place multiple holds or not','','YesNo')"); + print "Upgrade to $DBversion done adding syspref DisplayMultiPlaceHold to control whether multiple holds can be placed from the search results page"; + SetVersion ($DBversion); +} + +$DBversion = '3.01.00.135'; +if (C4::Context->preference('Version') < TransformToNum($DBversion)){ + $dbh->do(" + INSERT INTO `letter` (module, code, name, title, content) VALUES +('reserves', 'HOLD_PRINT', 'Hold Available for Pickup (print notice)', 'Hold Available for Pickup (print notice)', '<<branches.branchname>>\r\n<<branches.branchaddress1>>\r\n<<branches.branchaddress2>>\r\n\r\n\r\nChange Service Requested\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n<<borrowers.firstname>> <<borrowers.surname>>\r\n<<borrowers.address>>\r\n<<borrowers.city>> <<borrowers.zipcode>>\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n<<borrowers.firstname>> <<borrowers.surname>> <<borrowers.cardnumber>>\r\n\r\nYou have a hold available for pickup as of <<reserves.waitingdate>>:\r\n\r\nTitle: <<biblio.title>>\r\nAuthor: <<biblio.author>>\r\nCopy: <<items.copynumber>>\r\n') +"); + print "Upgrade to $DBversion done (bug 4377: added HOLD_PRINT message template)"; + SetVersion ($DBversion); +} + +$DBversion = '3.01.00.136'; +if (C4::Context->preference('Version') < TransformToNum($DBversion)){ + $dbh->do(qq{ +INSERT INTO permissions (module_bit, code, description) VALUES + ( 9, 'edit_items', 'Edit Items');}); + print "Upgrade to $DBversion done Adding a new permission to edit items"; + SetVersion ($DBversion); +} + +$DBversion = "3.01.00.137"; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do(" + INSERT INTO permissions (module_bit, code, description) VALUES + (15, 'check_expiration', 'Check the expiration of a serial'), + (15, 'claim_serials', 'Claim missing serials'), + (15, 'create_subscription', 'Create a new subscription'), + (15, 'delete_subscription', 'Delete an existing subscription'), + (15, 'edit_subscription', 'Edit an existing subscription'), + (15, 'receive_serials', 'Serials receiving'), + (15, 'renew_subscription', 'Renew a subscription'), + (15, 'routing', 'Routing'); + "); + print "Upgrade to $DBversion done (adding granular permissions for serials)"; + SetVersion ($DBversion); +} + +$DBversion = "3.01.00.138"; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do("DELETE FROM systempreferences WHERE variable = 'GranularPermissions'"); + print "Upgrade to $DBversion done (bug 4896: removing GranularPermissions syspref; use of granular permissions is now the default)"; + SetVersion ($DBversion); +} + +$DBversion = '3.01.00.139'; +if (C4::Context->preference('Version') < TransformToNum($DBversion)){ + $dbh->do("ALTER TABLE message_attributes CHANGE message_name message_name varchar(40);"); + print "Upgrade to $DBversion done (bug 3682: change message_name from varchar(20) to varchar(40))\n"; + SetVersion ($DBversion); +} + +$DBversion = '3.01.00.140'; +if (C4::Context->preference('Version') < TransformToNum($DBversion)){ + $dbh->do("UPDATE systempreferences SET value = '0' WHERE variable = 'TagsModeration' AND value is NULL"); + print "Upgrade to $DBversion done (bug 4312 TagsModeration changed from NULL to 0)\n"; + SetVersion ($DBversion); +} + +$DBversion = '3.01.00.141'; +if (C4::Context->preference('Version') < TransformToNum($DBversion)){ + $dbh->do(qq{DELETE FROM message_attributes WHERE message_attribute_id=3;}); + $dbh->do(qq{DELETE FROM letter WHERE code='EVENT' AND title='Upcoming Library Event';}); + print "Upgrade to $DBversion done Remove upcoming events messaging option (bug 2434)"; + SetVersion ($DBversion); +} + +$DBversion = '3.01.00.142'; +if (C4::Context->preference('Version') < TransformToNum($DBversion)){ + $dbh->do(qq{DELETE FROM message_transports WHERE message_attribute_id=3;}); + print "Upgrade to $DBversion done Remove upcoming events messaging option part 2 (bug 2434)"; + SetVersion ($DBversion); +} + +$DBversion = '3.01.00.143'; +if (C4::Context->preference('Version') < TransformToNum($DBversion)){ + $dbh->do(qq{CREATE INDEX auth_value_idx ON authorised_values (authorised_value)}); + $dbh->do(qq{CREATE INDEX auth_val_cat_idx ON borrower_attribute_types (authorised_value_category)}); + print "Create index on authorised_values and borrower_attribute_types (bug 4139)"; + SetVersion ($DBversion); +} + + =item DropAllForeignKeys($table) Drop all foreign keys of the table $table