Bug 6874: Attach files to bibliographic records
[koha-ffzg.git] / installer / data / mysql / updatedatabase.pl
index 0ada58c..705b4bc 100755 (executable)
@@ -38,7 +38,6 @@ use C4::Context;
 use C4::Installer;
 use C4::Dates;
 use Koha::Database;
-
 use Koha;
 
 use MARC::Record;
@@ -10675,6 +10674,79 @@ if ( CheckVersion($DBversion) ) {
     SetVersion ($DBversion);
 }
 
+$DBversion = "3.21.00.014";
+if ( CheckVersion($DBversion) ) {
+    $dbh->do(q{
+        INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type)
+        VALUES ('OAI-PMH:DeletedRecord','persistent','Koha\'s deletedbiblio table will never be deleted (persistent) or might be deleted (transient)','transient|persistent','Choice')
+    });
+    $dbh->do(q|
+        ALTER TABLE oai_sets_biblios DROP FOREIGN KEY oai_sets_biblios_ibfk_1
+    |);
+    print "Upgrade to $DBversion done (Bug 3206: OAI repository deleted record support)\n";
+    SetVersion ($DBversion);
+}
+
+$DBversion = "3.21.00.015";
+if ( CheckVersion($DBversion) ) {
+    $dbh->do(q{
+        UPDATE systempreferences SET value='0' WHERE variable='CalendarFirstDayOfWeek' AND value='Sunday';
+    });
+    $dbh->do(q{
+        UPDATE systempreferences SET value='1' WHERE variable='CalendarFirstDayOfWeek' AND value='Monday';
+    });
+    $dbh->do(q{
+        UPDATE systempreferences SET options='0|1|2|3|4|5|6' WHERE variable='CalendarFirstDayOfWeek';
+    });
+
+    print "Upgrade to $DBversion done (Bug 12137: Extend functionality of CalendarFirstDayOfWeek to be any day)\n";
+    SetVersion($DBversion);
+}
+
+$DBversion = "3.21.00.016";
+if ( CheckVersion($DBversion) ) {
+    my $rs = $schema->resultset('Systempreference');
+    $rs->find_or_create(
+        {
+            variable => 'DumpTemplateVarsIntranet',
+            value    => 0,
+            explanation => 'If enabled, dump all Template Toolkit variable to a comment in the html source for the staff intranet.',
+            type => 'YesNo',
+        }
+    );
+    $rs->find_or_create(
+        {
+            variable => 'DumpTemplateVarsOpac',
+            value    => 0,
+            explanation => 'If enabled, dump all Template Toolkit variable to a comment in the html source for the opac.',
+            type => 'YesNo',
+        }
+    );
+    print "Upgrade to $DBversion done (Bug 13948: Add ability to dump template toolkit variables to html comment)\n";
+    SetVersion($DBversion);
+}
+
+$DBversion = "XXX";
+if ( CheckVersion($DBversion) ) {
+    $dbh->do("
+        INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type)
+        VALUES('uploadPath','','Sets the upload path for the upload.pl plugin','','');
+    ");
+
+    $dbh->do("
+        CREATE TABLE uploaded_files (
+            id CHAR(40) NOT NULL PRIMARY KEY,
+            filename TEXT NOT NULL,
+            dir TEXT NOT NULL
+        ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+    ");
+
+    print "Upgrade to $DBversion done (Bug 6874: New cataloging plugin upload.pl)\n";
+    print "This plugin comes with a new syspref (uploadPath) and a new table (uploaded_files)\n";
+    print "To use it, set 'uploadPath' and 'OPACBaseURL' system preferences and link this plugin to a subfield (856\$u for instance)\n";
+    SetVersion($DBversion);
+}
+
 # DEVELOPER PROCESS, search for anything to execute in the db_update directory
 # SEE bug 13068
 # if there is anything in the atomicupdate, read and execute it.