UpdateDatabases for 3.0.2
updating elements in order to make 3.0.2 work Signed-off-by: Henri-Damien LAURENT <henridamien.laurent@biblibre.com>
This commit is contained in:
parent
259af7ad61
commit
c1901a84ae
|
|
@ -419,6 +419,7 @@ CREATE TABLE `biblioitems` (
|
|||
KEY `bibinoidx` (`biblioitemnumber`),
|
||||
KEY `bibnoidx` (`biblionumber`),
|
||||
KEY `isbn` (`isbn`),
|
||||
KEY `issn` (`issn`),
|
||||
KEY `publishercode` (`publishercode`),
|
||||
CONSTRAINT `biblioitems_ibfk_1` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
|
@ -521,8 +522,8 @@ DROP TABLE IF EXISTS `borrower_attributes`;
|
|||
CREATE TABLE `borrower_attributes` (
|
||||
`borrowernumber` int(11) NOT NULL,
|
||||
`code` varchar(10) NOT NULL,
|
||||
`attribute` varchar(30) default NULL,
|
||||
`password` varchar(30) default NULL,
|
||||
`attribute` varchar(64) default NULL,
|
||||
`password` varchar(64) default NULL,
|
||||
KEY `borrowernumber` (`borrowernumber`),
|
||||
KEY `code_attribute` (`code`, `attribute`),
|
||||
CONSTRAINT `borrower_attributes_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`)
|
||||
|
|
@ -835,6 +836,7 @@ CREATE TABLE `deletedborrowers` (
|
|||
`phonepro` text,
|
||||
`B_streetnumber` varchar(10) default NULL,
|
||||
`B_streettype` varchar(50) default NULL,
|
||||
`smsalertnumber` varchar(50) default NULL,
|
||||
`B_address` varchar(100) default NULL,
|
||||
`B_city` mediumtext,
|
||||
`B_zipcode` varchar(25) default NULL,
|
||||
|
|
@ -2063,7 +2065,7 @@ CREATE TABLE `z3950servers` (
|
|||
DROP TABLE IF EXISTS `zebraqueue`;
|
||||
CREATE TABLE `zebraqueue` (
|
||||
`id` int(11) NOT NULL auto_increment,
|
||||
`biblio_auth_number` int(11) NOT NULL default '0',
|
||||
`biblio_auth_number` bigint(20) unsigned NOT NULL default '0',
|
||||
`operation` char(20) NOT NULL default '',
|
||||
`server` char(20) NOT NULL default '',
|
||||
`done` int(11) NOT NULL default '0',
|
||||
|
|
|
|||
|
|
@ -107,8 +107,20 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
|
|||
|
||||
$DBversion = "3.00.01.003";
|
||||
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
|
||||
$dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('MergeAuthoritiesOnUpdate', '1', 'if ON, Updateing authorities will automatically updates biblios',NULL,'YesNo')");
|
||||
print "Upgrade to $DBversion done (add new syspref)\n";
|
||||
my $search=$dbh->selectall_arrayref("select * from systempreferences where variable='dontmerge'");
|
||||
if (@$search){
|
||||
my $search=$dbh->selectall_arrayref("select * from systempreferences where variable='MergeAuthoritiesOnUpdate'");
|
||||
if (@$search){
|
||||
$dbh->do("DELETE FROM systempreferences set variable='dontmerge'");
|
||||
}
|
||||
else {
|
||||
$dbh->do("UPDATE systempreferences set variable='MergeAuthoritiesOnUpdate' ,value=1-value*1 WHERE variable='dontmerge'");
|
||||
}
|
||||
}
|
||||
else {
|
||||
$dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('MergeAuthoritiesOnUpdate', '1', 'if ON, Updating authorities will automatically updates biblios',NULL,'YesNo')");
|
||||
}
|
||||
print "Upgrade to $DBversion done (add new syspref MergeAuthoritiesOnUpdate)\n";
|
||||
SetVersion ($DBversion);
|
||||
}
|
||||
|
||||
|
|
@ -170,6 +182,161 @@ ENDOFRENEWAL
|
|||
print "Upgrade to $DBversion done (Change the field)\n";
|
||||
SetVersion ($DBversion);
|
||||
}
|
||||
$DBversion = "3.00.02.001";
|
||||
#01.00.005';
|
||||
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
|
||||
$dbh->do("
|
||||
INSERT INTO `letter` (module, code, name, title, content)
|
||||
VALUES('reserves', 'HOLD', 'Hold Available for Pickup', 'Hold Available for Pickup at <<branches.branchname>>', 'Dear <<borrowers.firstname>> <<borrowers.surname>>,\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\nLocation: <<branches.branchname>>\r\n<<branches.branchaddress1>>\r\n<<branches.branchaddress2>>\r\n<<branches.branchaddress3>>')
|
||||
");
|
||||
$dbh->do("INSERT INTO `message_attributes` (message_attribute_id, message_name, takes_days) values(4, 'Hold Filled', 0)");
|
||||
$dbh->do("INSERT INTO `message_transports` (message_attribute_id, message_transport_type, is_digest, letter_module, letter_code) values(4, 'sms', 0, 'reserves', 'HOLD')");
|
||||
$dbh->do("INSERT INTO `message_transports` (message_attribute_id, message_transport_type, is_digest, letter_module, letter_code) values(4, 'email', 0, 'reserves', 'HOLD')");
|
||||
print "Upgrade to $DBversion done (Add letter for holds notifications)\n";
|
||||
SetVersion ($DBversion);
|
||||
}
|
||||
|
||||
$DBversion = "3.00.02.002";
|
||||
#$DBversion = '3.01.00.006';
|
||||
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
|
||||
$dbh->do("ALTER TABLE `biblioitems` ADD KEY issn (issn)");
|
||||
print "Upgrade to $DBversion done (add index on biblioitems.issn)\n";
|
||||
SetVersion ($DBversion);
|
||||
}
|
||||
|
||||
$DBversion = "3.00.02.003";
|
||||
#$DBversion = "3.01.00.007";
|
||||
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
|
||||
$dbh->do("UPDATE `systempreferences` SET options='70|10' WHERE variable='intranetmainUserblock'");
|
||||
$dbh->do("UPDATE `systempreferences` SET options='70|10' WHERE variable='intranetuserjs'");
|
||||
$dbh->do("UPDATE `systempreferences` SET options='70|10' WHERE variable='opacheader'");
|
||||
$dbh->do("UPDATE `systempreferences` SET options='70|10' WHERE variable='OpacMainUserBlock'");
|
||||
$dbh->do("UPDATE `systempreferences` SET options='70|10' WHERE variable='OpacNav'");
|
||||
$dbh->do("UPDATE `systempreferences` SET options='70|10' WHERE variable='opacuserjs'");
|
||||
$dbh->do("UPDATE `systempreferences` SET options='30|10', type='Textarea' WHERE variable='OAI-PMH:Set'");
|
||||
$dbh->do("UPDATE `systempreferences` SET options='50' WHERE variable='intranetstylesheet'");
|
||||
$dbh->do("UPDATE `systempreferences` SET options='50' WHERE variable='intranetcolorstylesheet'");
|
||||
$dbh->do("UPDATE `systempreferences` SET options='10' WHERE variable='globalDueDate'");
|
||||
$dbh->do("UPDATE `systempreferences` SET type='Integer' WHERE variable='numSearchResults'");
|
||||
$dbh->do("UPDATE `systempreferences` SET type='Integer' WHERE variable='OPACnumSearchResults'");
|
||||
$dbh->do("UPDATE `systempreferences` SET type='Integer' WHERE variable='ReservesMaxPickupDelay'");
|
||||
$dbh->do("UPDATE `systempreferences` SET type='Integer' WHERE variable='TransfersMaxDaysWarning'");
|
||||
$dbh->do("UPDATE `systempreferences` SET type='Integer' WHERE variable='StaticHoldsQueueWeight'");
|
||||
$dbh->do("UPDATE `systempreferences` SET type='Integer' WHERE variable='holdCancelLength'");
|
||||
$dbh->do("UPDATE `systempreferences` SET type='Integer' WHERE variable='XISBNDailyLimit'");
|
||||
$dbh->do("UPDATE `systempreferences` SET type='Float' WHERE variable='gist'");
|
||||
$dbh->do("UPDATE `systempreferences` SET type='Free' WHERE variable='BakerTaylorUsername'");
|
||||
$dbh->do("UPDATE `systempreferences` SET type='Free' WHERE variable='BakerTaylorPassword'");
|
||||
$dbh->do("UPDATE `systempreferences` SET type='Textarea', options='70|10' WHERE variable='ISBD'");
|
||||
$dbh->do("UPDATE `systempreferences` SET type='Textarea', options='70|10', explanation='Enter a specific hash for NoZebra indexes. Enter : \\\'indexname\\\' => \\\'100a,245a,500*\\\',\\\'index2\\\' => \\\'...\\\'' WHERE variable='NoZebraIndexes'");
|
||||
print "Upgrade to $DBversion done (fix display of many sysprefs)\n";
|
||||
SetVersion ($DBversion);
|
||||
}
|
||||
|
||||
|
||||
$DBversion = "3.00.02.004";
|
||||
#$DBversion = "3.01.00.009";
|
||||
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
|
||||
$dbh->do("INSERT INTO permissions (module_bit, code, description) VALUES ( 1, 'circulate_remaining_permissions', 'Remaining circulation permissions')");
|
||||
$dbh->do("INSERT INTO permissions (module_bit, code, description) VALUES ( 1, 'override_renewals', 'Override blocked renewals')");
|
||||
print "Upgrade to $DBversion done (added subpermissions for circulate permission)\n";
|
||||
}
|
||||
|
||||
$DBversion = "3.00.02.005";
|
||||
#$DBversion = '3.01.00.010';
|
||||
if ( C4::Context->preference('Version') < TransformToNum($DBversion) ) {
|
||||
$dbh->do("ALTER TABLE `borrower_attributes` MODIFY COLUMN `attribute` VARCHAR(64) DEFAULT NULL");
|
||||
$dbh->do("ALTER TABLE `borrower_attributes` MODIFY COLUMN `password` VARCHAR(64) DEFAULT NULL");
|
||||
print "Upgrade to $DBversion done (bug 2687: increase length of borrower attribute fields)\n";
|
||||
SetVersion ($DBversion);
|
||||
}
|
||||
|
||||
$DBversion = "3.00.02.006";
|
||||
#$DBversion = '3.01.00.011';
|
||||
if ( C4::Context->preference('Version') < TransformToNum($DBversion) ) {
|
||||
|
||||
# Yes, the old value was ^M terminated.
|
||||
my $bad_value = "function prepareEmailPopup(){\r\n if (!document.getElementById) return false;\r\n if (!document.getElementById('reserveemail')) return false;\r\n rsvlink = document.getElementById('reserveemail');\r\n rsvlink.onclick = function() {\r\n doReservePopup();\r\n return false;\r\n }\r\n}\r\n\r\nfunction doReservePopup(){\r\n}\r\n\r\nfunction prepareReserveList(){\r\n}\r\n\r\naddLoadEvent(prepareEmailPopup);\r\naddLoadEvent(prepareReserveList);";
|
||||
|
||||
my $intranetuserjs = C4::Context->preference('intranetuserjs');
|
||||
if ($intranetuserjs and $intranetuserjs eq $bad_value) {
|
||||
my $sql = <<'END_SQL';
|
||||
UPDATE systempreferences
|
||||
SET value = ''
|
||||
WHERE variable = 'intranetuserjs'
|
||||
END_SQL
|
||||
$dbh->do($sql);
|
||||
}
|
||||
print "Upgrade to $DBversion done (removed bogus intranetuserjs syspref)\n";
|
||||
SetVersion($DBversion);
|
||||
}
|
||||
|
||||
|
||||
$DBversion = "3.00.02.007";
|
||||
#$DBversion = '3.01.00.015';
|
||||
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
|
||||
$dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OPACAmazonCoverImages', '0', 'Display cover images on OPAC from Amazon Web Services','','YesNo')");
|
||||
|
||||
$dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('AmazonCoverImages', '0', 'Display Cover Images in Staff Client from Amazon Web Services','','YesNo')");
|
||||
|
||||
$dbh->do("UPDATE systempreferences SET variable='AmazonEnabled' WHERE variable = 'AmazonContent'");
|
||||
|
||||
$dbh->do("UPDATE systempreferences SET variable='OPACAmazonEnabled' WHERE variable = 'OPACAmazonContent'");
|
||||
|
||||
print "Upgrade to $DBversion done (added Syndetics Enhanced Content system preferences)\n";
|
||||
SetVersion ($DBversion);
|
||||
}
|
||||
|
||||
|
||||
|
||||
$DBversion = "3.00.02.008";
|
||||
#$DBversion = "3.01.00.018";
|
||||
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
|
||||
$dbh->do("ALTER TABLE deletedborrowers ADD `smsalertnumber` varchar(50) default NULL");
|
||||
print "Upgrade to $DBversion done (added deletedborrowers.smsalertnumber, missed in 3.00.00.091)\n";
|
||||
SetVersion ($DBversion);
|
||||
}
|
||||
|
||||
|
||||
$DBversion = "3.00.02.009";
|
||||
#$DBversion = '3.01.00.023';
|
||||
if ( C4::Context->preference('Version') < TransformToNum($DBversion) ) {
|
||||
$dbh->do("ALTER TABLE biblioitems MODIFY COLUMN isbn VARCHAR(30) DEFAULT NULL");
|
||||
$dbh->do("ALTER TABLE deletedbiblioitems MODIFY COLUMN isbn VARCHAR(30) DEFAULT NULL");
|
||||
$dbh->do("ALTER TABLE import_biblios MODIFY COLUMN isbn VARCHAR(30) DEFAULT NULL");
|
||||
$dbh->do("ALTER TABLE suggestions MODIFY COLUMN isbn VARCHAR(30) DEFAULT NULL");
|
||||
print "Upgrade to $DBversion done (bug 2765: increase width of isbn column in several tables)\n";
|
||||
SetVersion ($DBversion);
|
||||
}
|
||||
|
||||
$DBversion = '3.00.02.010';
|
||||
#$DBversion = '3.01.00.027';
|
||||
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
|
||||
$dbh->do("ALTER TABLE zebraqueue CHANGE `biblio_auth_number` `biblio_auth_number` bigint(20) unsigned NOT NULL default 0");
|
||||
print "Upgrade to $DBversion done (Increased size of zebraqueue biblio_auth_number to address bug 3148.)\n";
|
||||
SetVersion ($DBversion);
|
||||
}
|
||||
|
||||
#$DBversion = '3.01.00.028';
|
||||
$DBversion = '3.00.02.011';
|
||||
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
|
||||
my $enable_reviews = C4::Context->preference('AmazonEnabled') ? '1' : '0';
|
||||
$dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('AmazonReviews', '$enable_reviews', 'Display Amazon reviews on staff interface','','YesNo')");
|
||||
print "Upgrade to $DBversion done (added AmazonReviews)\n";
|
||||
SetVersion ($DBversion);
|
||||
}
|
||||
|
||||
#$DBversion = '3.01.00.029';
|
||||
$DBversion = '3.00.02.012';
|
||||
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
|
||||
$dbh->do(q( UPDATE language_rfc4646_to_iso639
|
||||
SET iso639_2_code = 'spa'
|
||||
WHERE rfc4646_subtag = 'es'
|
||||
AND iso639_2_code = 'rus' )
|
||||
);
|
||||
print "Upgrade to $DBversion done (fixed bug 2599: using Spanish search limit retrieves Russian results)\n";
|
||||
SetVersion ($DBversion);
|
||||
}
|
||||
|
||||
=item DropAllForeignKeys($table)
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
use strict;
|
||||
|
||||
sub kohaversion {
|
||||
our $VERSION = '3.00.01.007';
|
||||
our $VERSION = '3.00.02.012';
|
||||
# version needs to be set this way
|
||||
# so that it can be picked up by Makefile.PL
|
||||
# during install
|
||||
|
|
|
|||
Loading…
Reference in New Issue