Bug 11706: Typo fix for "efault" in old database update
[koha-ffzg.git] / installer / data / mysql / updatedatabase.pl
index 8ad77c2..a0698ef 100755 (executable)
@@ -7205,7 +7205,7 @@ $DBversion = "3.13.00.029";
 if ( CheckVersion($DBversion) ) {
     $dbh->do(q{
         INSERT IGNORE INTO export_format( profile, description, content, csv_separator, type )
-        VALUES ( "issues to claim", "efault CSV export for serial issue claims",
+        VALUES ( "issues to claim", "Default CSV export for serial issue claims",
                 "SUPPLIER=aqbooksellers.name|TITLE=subscription.title|ISSUE NUMBER=serial.serialseq|LATE SINCE=serial.planneddate",
                 ",", "sql" )
     });
@@ -9522,7 +9522,7 @@ if ( CheckVersion($DBversion) ) {
 $DBversion = "3.17.00.057";
 if ( CheckVersion($DBversion) ) {
     print "Upgrade to $DBversion done (Koha 3.18 beta)\n";
-    SetVersion($DBversion);
+    SetVersion ($DBversion);
 }
 
 $DBversion = "3.17.00.058";
@@ -9534,6 +9534,57 @@ if( CheckVersion($DBversion) ){
     SetVersion($DBversion);
 }
 
+$DBversion = "3.17.00.059";
+if ( CheckVersion($DBversion) ) {
+    $dbh->do(q{
+        UPDATE permissions SET description = "Add and delete budgets (but can't modifiy budgets)" WHERE description = "Add and delete budgets (but cant modify budgets)";
+    });
+    print "Upgrade to $DBversion done (Bug 10749: Fix typo in budget_add_del permission description)\n";
+    SetVersion ($DBversion);
+}
+
+$DBversion = "3.17.00.060";
+if ( CheckVersion($DBversion) ) {
+    my $count_l = $dbh->selectcol_arrayref(q|
+        SELECT COUNT(*) FROM letter WHERE message_transport_type='feed'
+    |);
+    my $count_mq = $dbh->selectcol_arrayref(q|
+        SELECT COUNT(*) FROM message_queue WHERE message_transport_type='feed'
+    |);
+    my $count_ott = $dbh->selectcol_arrayref(q|
+        SELECT COUNT(*) FROM overduerules_transport_types WHERE message_transport_type='feed'
+    |);
+    my $count_mt = $dbh->selectcol_arrayref(q|
+        SELECT COUNT(*) FROM message_transports WHERE message_transport_type='feed'
+    |);
+    my $count_bmtp = $dbh->selectcol_arrayref(q|
+        SELECT COUNT(*) FROM borrower_message_transport_preferences WHERE message_transport_type='feed'
+    |);
+
+    my $deleted = 0;
+    if ( $count_l->[0] == 0 and $count_mq->[0] == 0 and $count_ott->[0] == 0 and $count_mt->[0] == 0 and $count_bmtp->[0] == 0 ) {
+        $deleted = $dbh->do(q|
+            DELETE FROM message_transport_types where message_transport_type='feed'
+        |);
+        $deleted = $deleted ne '0E0' ? 1 : 0;
+    }
+
+    print "Upgrade to $DBversion done (Bug 12298: Delete the 'feed' message transport type " . ($deleted ? '(deleted!)' : '(not deleted)') . ")\n";
+    SetVersion($DBversion);
+}
+
+$DBversion = "3.18.00.000";
+if ( CheckVersion($DBversion) ) {
+    print "Upgrade to $DBversion done (3.18.0 release)\n";
+    SetVersion ($DBversion);
+}
+
+$DBversion = "3.19.00.000";
+if ( CheckVersion($DBversion) ) {
+    print "Upgrade to $DBversion done (there's life after 3.18)\n";
+    SetVersion ($DBversion);
+}
+
 =head1 FUNCTIONS
 
 =head2 TableExists($table)