) ENGINE=InnoDB DEFAULT CHARSET=utf8;
});
+ # debarments with end date
$dbh->do(q{
-INSERT INTO borrower_debarments ( borrowernumber, expiration, comment ) SELECT borrowernumber, debarred, debarredcomment FROM borrowers WHERE debarred IS NOT NULL
+INSERT INTO borrower_debarments ( borrowernumber, expiration, comment ) SELECT borrowernumber, debarred, debarredcomment FROM borrowers WHERE debarred IS NOT NULL AND debarred <> '9999-12-31'
+ });
+ # debarments with no end date
+ $dbh->do(q{
+INSERT INTO borrower_debarments ( borrowernumber, comment ) SELECT borrowernumber, debarredcomment FROM borrowers WHERE debarred = '9999-12-31'
});
$dbh->do(q{
}
$DBversion = "3.15.00.016";
-if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
+if (CheckVersion($DBversion)) {
$dbh->do("ALTER TABLE biblioitems CHANGE url url TEXT NULL DEFAULT NULL");
$dbh->do("ALTER TABLE deletedbiblioitems CHANGE url url TEXT NULL DEFAULT NULL");
print "Upgrade to $DBversion done (Bug 11268 - Biblioitems URL field is too small for some URLs)\n";
}
$DBversion = "3.15.00.019";
-if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
+if ( CheckVersion($DBversion) ) {
$dbh->do("INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES('OpacMaxItemsToDisplay','50','','Max items to display at the OPAC on a biblio detail','Integer')");
print "Upgrade to $DBversion done (Bug 11256: Add system preference OpacMaxItemsToDisplay)\n";
SetVersion($DBversion);
}
$DBversion = "3.15.00.020";
-if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
+if ( CheckVersion($DBversion) ) {
$dbh->do(q|
INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES('MaxItemsForBatch','1000',NULL,'Max number of items record to process in a batch (modification or deletion)','Integer')
|);
SetVersion($DBversion);
}
+$DBversion = "3.15.00.025";
+if ( CheckVersion($DBversion) ) {
+ $dbh->do(q{
+ DROP TABLE aqorderdelivery;
+ });
+ print "Upgrade to $DBversion done (Bug 11928 - remove unused table)\n";
+ SetVersion($DBversion);
+}
+
+$DBversion = "3.15.00.026";
+if ( CheckVersion($DBversion) ) {
+ $dbh->do(q{
+ UPDATE language_descriptions SET description = 'Հայերեն' WHERE subtag = 'hy' AND lang = 'hy';
+ });
+ print "Upgrade to $DBversion done (Bug 11973 - Fix Armenian language description)\n";
+ SetVersion($DBversion);
+}
+
+$DBversion = "3.15.00.027";
+if (CheckVersion($DBversion)) {
+ $dbh->do(q{
+ ALTER TABLE opac_news ADD branchcode varchar(10) DEFAULT NULL
+ AFTER idnew,
+ ADD CONSTRAINT opac_news_branchcode_ibfk
+ FOREIGN KEY (branchcode)
+ REFERENCES branches (branchcode)
+ ON DELETE CASCADE ON UPDATE CASCADE;
+ });
+ print "Upgrade to $DBversion done (Bug 7567: Add branchcode to opac_news)\n";
+ SetVersion($DBversion);
+}
+
+$DBversion = "3.15.00.028";
+if(CheckVersion($DBversion)) {
+ $dbh->do(q{
+ ALTER TABLE issuingrules ADD norenewalbefore int(4) default NULL AFTER renewalperiod
+ });
+ print "Upgrade to $DBversion done (Bug 7413: Allow OPAC renewal x days before due date)\n";
+ SetVersion($DBversion);
+}
+
+$DBversion = "3.15.00.029";
+if ( CheckVersion($DBversion) ) {
+ $dbh->do(q{
+ UPDATE borrower_debarments SET expiration = NULL WHERE expiration = '9999-12-31'
+ });
+ print "Upgrade to $DBversion done (Bug 11846 - correct borrower_debarments with expiration 9999-12-31)\n";
+ SetVersion($DBversion);
+}
+
+$DBversion = "3.15.00.030";
+if(CheckVersion($DBversion)) {
+ $dbh->do(q|
+ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('OPACMySummaryNote','','','Note to display on the patron summary page. This note only appears if the patron is connected.','Free')
+ |);
+ print "Upgrade to $DBversion done (Bug 12052: Add OPACMySummaryNote syspref)\n";
+ SetVersion($DBversion);
+}
+
+$DBversion = "3.15.00.031";
+if ( CheckVersion($DBversion) ) {
+ $dbh->do("INSERT INTO permissions (module_bit, code, description) VALUES ('10', 'writeoff', 'Write off fines and fees')");
+ $dbh->do("INSERT INTO permissions (module_bit, code, description) VALUES ('10', 'remaining_permissions', 'Remaining permissions for managing fines and fees')");
+ print "Upgrade to $DBversion done (Bug 9448 - Add separate permission for writing off fees)\n";
+ SetVersion ($DBversion);
+}
+
+$DBversion = "3.15.00.032";
+if ( CheckVersion($DBversion) ) {
+ $dbh->do("ALTER TABLE aqorders CHANGE notes order_internalnote MEDIUMTEXT;");
+ $dbh->do("ALTER TABLE aqorders ADD COLUMN order_vendornote MEDIUMTEXT AFTER order_internalnote;");
+ print "Upgrade to $DBversion done (Bug 9416 - In each order, add a new note made for the vendor)\n";
+ SetVersion ($DBversion);
+}
+
+$DBversion = "3.15.00.033";
+if ( CheckVersion($DBversion) ) {
+ $dbh->do("INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('NoLoginInstructions', '', '60|10', 'Instructions to display on the OPAC login form when a patron is not logged in', 'Textarea')");
+ print "Upgrade to $DBversion done (Bug 10951: Add NoLoginInstructions pref)\n";
+ SetVersion($DBversion);
+}
+
=head1 FUNCTIONS
=head2 TableExists($table)