X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=installer%2Fdata%2Fmysql%2Fupdatedatabase.pl;h=68e7cbcf4f90c662493a9a463c010c1363561811;hb=17800939e8a3e6f34549ade0e5e068728e5cb907;hp=02239f9329ec72cf753dfbdabb1d132db521ca3c;hpb=09895c5fe68ba8b2b20fb0ebe09aef535280fbfa;p=koha_fer diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 02239f9329..68e7cbcf4f 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -2874,6 +2874,8 @@ if (C4::Context->preference("Version") < TransformToNum($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` ( @@ -2890,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.. @@ -2906,16 +2908,19 @@ ADDPERIODS #$dbh->do("drop table aqbudget;"); - $dbh->do(<selectcol_arrayref(<selectcol_arrayref(<do(<do(<do(<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); @@ -3541,6 +3545,149 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { 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)', '<>\r\n<>\r\n<>\r\n\r\n\r\nChange Service Requested\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n<> <>\r\n<>\r\n<> <>\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n<> <> <>\r\n\r\nYou have a hold available for pickup as of <>:\r\n\r\nTitle: <>\r\nAuthor: <>\r\nCopy: <>\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