SetVersion($DBversion);
}
-
$DBversion = "3.13.00.020";
if ( CheckVersion($DBversion) ) {
$dbh->do("INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES('WhenLostForgiveFine','0',NULL,'If ON, Forgives the fines on an item when it is lost.','YesNo')");
$dbh->do("INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES('WhenLostChargeReplacementFee','1',NULL,'If ON, Charge the replacement price when a patron loses an item.','YesNo')");
print "Upgrade to $DBversion done (Bug 7639: system preferences to forgive fines on lost items)\n";
- SetVersion ($DBversion);
+ SetVersion($DBversion);
}
$DBversion ="3.13.00.021";
|);
my $check_numberpatterns_sth = $dbh->prepare(qq|
SELECT * FROM subscription_numberpatterns
- WHERE add1 = ? AND add2 = ? AND add3 = ?
- AND every1 = ? AND every2 = ? AND every3 = ?
- AND whenmorethan1 = ? AND whenmorethan2 = ? AND whenmorethan3 = ?
- AND setto1 = ? AND setto2 = ? AND setto3 = ?
- AND numberingmethod = ?
+ WHERE (add1 = ? OR (add1 IS NULL AND ? IS NULL)) AND (add2 = ? OR (add2 IS NULL AND ? IS NULL))
+ AND (add3 = ? OR (add3 IS NULL AND ? IS NULL)) AND (every1 = ? OR (every1 IS NULL AND ? IS NULL))
+ AND (every2 = ? OR (every2 IS NULL AND ? IS NULL)) AND (every3 = ? OR (every3 IS NULL AND ? IS NULL))
+ AND (whenmorethan1 = ? OR (whenmorethan1 IS NULL AND ? IS NULL)) AND (whenmorethan2 = ? OR (whenmorethan2 IS NULL AND ? IS NULL))
+ AND (whenmorethan3 = ? OR (whenmorethan3 IS NULL AND ? IS NULL)) AND (setto1 = ? OR (setto1 IS NULL AND ? IS NULL))
+ AND (setto2 = ? OR (setto2 IS NULL AND ? IS NULL)) AND (setto3 = ? OR (setto3 IS NULL AND ? IS NULL))
+ AND (numberingmethod = ? OR (numberingmethod IS NULL AND ? IS NULL))
LIMIT 1
|);
my $update_subscription_sth = $dbh->prepare(qq|
my $i = 1;
while(my $sub = $sth->fetchrow_hashref) {
$check_numberpatterns_sth->execute(
- $sub->{add1}, $sub->{add2}, $sub->{add3},
- $sub->{every1}, $sub->{every2}, $sub->{every3},
- $sub->{whenmorethan1}, $sub->{whenmorethan2}, $sub->{whenmorethan3},
- $sub->{setto1}, $sub->{setto2}, $sub->{setto3},
- $sub->{numberingmethod}
+ $sub->{add1}, $sub->{add1}, $sub->{add2}, $sub->{add2}, $sub->{add3}, $sub->{add3},
+ $sub->{every1}, $sub->{every1}, $sub->{every2}, $sub->{every2}, $sub->{every3}, $sub->{every3},
+ $sub->{whenmorethan1}, $sub->{whenmorethan1}, $sub->{whenmorethan2}, $sub->{whenmorethan2},
+ $sub->{whenmorethan3}, $sub->{whenmorethan3}, $sub->{setto1}, $sub->{setto1}, $sub->{setto2},
+ $sub->{setto2}, $sub->{setto3}, $sub->{setto3}, $sub->{numberingmethod}, $sub->{numberingmethod}
);
my $p = $check_numberpatterns_sth->fetchrow_hashref;
if (defined $p) {
SetVersion($DBversion);
}
-
-$DBversion = "3.13.00.XXX";
+$DBversion = "3.15.00.042";
if ( CheckVersion($DBversion) ) {
$dbh->do(q{
INSERT INTO systempreferences
SetVersion($DBversion);
}
+$DBversion = "3.15.00.043";
+if ( CheckVersion($DBversion) ) {
+ $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('MarcFieldsToOrder','','Set the mapping values for a new order line created from a MARC record in a staged file. In a YAML format.', NULL, 'textarea')");
+ print "Upgrade to $DBversion done (Bug 7180: Added MarcFieldsToOrder syspref)\n";
+ SetVersion ($DBversion);
+}
+
+$DBversion = "3.15.00.044";
+if ( CheckVersion($DBversion) ) {
+ $dbh->do("ALTER TABLE currency ADD isocode VARCHAR(5) default NULL AFTER symbol;");
+ print "Upgrade to $DBversion done (Added isocode to the currency table)\n";
+ SetVersion($DBversion);
+}
+
+$DBversion = "3.15.00.045";
+if ( CheckVersion($DBversion) ) {
+ $dbh->do("
+ INSERT INTO systempreferences (variable,value,explanation,options,type)
+ VALUES (
+ 'BlockExpiredPatronOpacActions',
+ '0',
+ 'Set whether an expired patron can perform opac actions such as placing holds or renew books, can be overridden on a per patron-type basis',
+ NULL,
+ 'YesNo'
+ )
+ ");
+ $dbh->do("ALTER TABLE `categories` ADD COLUMN `BlockExpiredPatronOpacActions` TINYINT(1) DEFAULT -1 NOT NULL AFTER category_type");
+ print "Upgraded to $DBversion done (Bug 6739 - expired patrons not blocked from opac actions)\n";
+ SetVersion ($DBversion);
+}
+
+$DBversion = "3.15.00.046";
+if ( CheckVersion($DBversion) ) {
+ $dbh->do(q|
+ ALTER TABLE search_history ADD COLUMN type VARCHAR(16) NOT NULL DEFAULT 'biblio' AFTER query_cgi
+ |);
+ print "Upgrade to $DBversion done (Bug 10807 - Add db field search_history.type)\n";
+ SetVersion($DBversion);
+}
+
+$DBversion = "3.15.00.047";
+if ( CheckVersion($DBversion) ) {
+ $dbh->do(q|
+ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('EnableSearchHistory','0','','Enable or disable search history','YesNo')
+ |);
+ print "Upgrade to $DBversion done (Bug 10862: Add EnableSearchHistory syspref)\n";
+ SetVersion($DBversion);
+}
+
+$DBversion = "3.15.00.048";
+if ( CheckVersion($DBversion) ) {
+ $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OpacSuppressionRedirect','1','Redirect the opac detail page for suppressed records to an explanatory page (otherwise redirect to 404 error page)','','YesNo')");
+ $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OpacSuppressionMessage', '','Display this message on the redirect page for suppressed biblios','70|10','Textarea')");
+ print "Upgrade to $DBversion done (Bug 10195: Records hidden with OpacSuppression can still be accessed)\n";
+ SetVersion($DBversion);
+}
+
+$DBversion = "3.15.00.049";
+if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
+ $dbh->do("ALTER TABLE biblioitems DROP INDEX isbn");
+ $dbh->do("ALTER TABLE biblioitems DROP INDEX issn");
+ $dbh->do("ALTER TABLE biblioitems
+ CHANGE isbn isbn MEDIUMTEXT NULL DEFAULT NULL,
+ CHANGE issn issn MEDIUMTEXT NULL DEFAULT NULL
+ ");
+ $dbh->do("ALTER TABLE biblioitems
+ ADD INDEX isbn ( isbn ( 255 ) ),
+ ADD INDEX issn ( issn ( 255 ) )
+ ");
+
+ $dbh->do("ALTER TABLE deletedbiblioitems DROP INDEX isbn");
+ $dbh->do("ALTER TABLE deletedbiblioitems
+ CHANGE isbn isbn MEDIUMTEXT NULL DEFAULT NULL,
+ CHANGE issn issn MEDIUMTEXT NULL DEFAULT NULL
+ ");
+ $dbh->do("ALTER TABLE deletedbiblioitems
+ ADD INDEX isbn ( isbn ( 255 ) )
+ ");
+
+ print "Upgrade to $DBversion done (Bug 11268 - Biblioitems URL field is too small for some URLs)\n";
+ SetVersion($DBversion);
+}
+
+$DBversion = "3.15.00.050";
+if ( CheckVersion($DBversion) ) {
+ $dbh->do("
+ INSERT INTO systempreferences (
+ variable,
+ value,
+ explanation,
+ type
+ ) VALUES (
+ 'AggressiveMatchOnISBN',
+ '0',
+ 'If enabled, attempt to match aggressively by trying all variations of the ISBNs in the imported record as a phrase in the ISBN fields of already cataloged records when matching on ISBN with the record import tool',
+ 'YesNo'
+ )
+ ");
+
+ print "Upgrade to $DBversion done (Bug 10500 - Improve isbn matching when importing records)\n";
+ SetVersion($DBversion);
+}
+
+$DBversion = "3.15.00.051";
+if ( CheckVersion($DBversion) ) {
+ print "Upgrade to $DBversion done (Koha 3.16 beta)\n";
+ SetVersion($DBversion);
+}
+
+$DBversion = "3.15.00.052";
+if ( CheckVersion($DBversion) ) {
+ print "Upgrade to $DBversion done (Koha 3.16 RC)\n";
+ SetVersion($DBversion);
+}
+
=head1 FUNCTIONS
=head2 TableExists($table)