Bug 24131: (follow-up) Another rebase
[koha-ffzg.git] / installer / data / mysql / updatedatabase.pl
index 9a6194c..178ac29 100755 (executable)
@@ -20228,7 +20228,7 @@ if( CheckVersion( $DBversion ) ) {
 
 $DBversion = '19.11.00.000';
 if( CheckVersion( $DBversion ) ) {
-    NewVersion( $DBversion, undef '19.11.00 release' );
+    NewVersion( $DBversion, undef, '19.11.00 release' );
 }
 
 $DBversion = '19.12.00.000';
@@ -20724,8 +20724,8 @@ if ( CheckVersion($DBversion) ) {
     if ( !column_exists( 'marc_tag_structure', 'important') ){
         $dbh->do("ALTER TABLE marc_tag_structure ADD COLUMN important TINYINT(4) NOT NULL DEFAULT 0  AFTER mandatory");
     }
-    SetVersion($DBversion);
-    print "Upgrade to $DBversion done (Bug 8643 - Add important constraint to marc subfields)\n";
+
+    NewVersion( $DBversion, 8643, 'Add important constraint to marc subfields' );
 }
 
 $DBversion = '19.12.00.021';
@@ -20774,8 +20774,7 @@ if( CheckVersion( $DBversion ) ) {
           ( 'Lost Item Found' )
     });
 
-    SetVersion( $DBversion );
-    print "Upgrade to $DBversion done (Bug 24592 - Update LOST_RETURN to LOST_FOUND)\n";
+    NewVersion( $DBversion, 24592, 'Update LOST_RETURN to LOST_FOUND');
 }
 
 $DBversion = '19.12.00.022';
@@ -20783,16 +20782,14 @@ if( CheckVersion( $DBversion ) ) {
     $dbh->do( "ALTER TABLE items MODIFY COLUMN uri MEDIUMTEXT" );
     $dbh->do( "ALTER TABLE deleteditems MODIFY COLUMN uri MEDIUMTEXT" );
 
-    SetVersion( $DBversion );
-    print "Upgrade to $DBversion done (Bug 20882 - items.uri to MEDIUMTEXT)\n";
+    NewVersion( $DBversion, 20882, 'items.uri to MEDIUMTEXT');
 }
 
 $DBversion = '19.12.00.023';
 if( CheckVersion( $DBversion ) ) {
     $dbh->do( "ALTER TABLE quotes MODIFY timestamp datetime NULL" );
 
-    SetVersion( $DBversion );
-    print "Upgrade to $DBversion done (Bug 24640 - Allow quotes.timestamp to be NULL)\n";
+    NewVersion( $DBversion, 24640, 'Allow quotes.timestamp to be NULL');
 }
 
 $DBversion = '19.12.00.024';
@@ -20806,8 +20803,8 @@ if( CheckVersion( $DBversion ) ) {
         explanation = "Choose the fines mode, 'off' (do not accrue fines) or 'production' (accrue overdue fines).  Requires accruefines cronjob or CalculateFinesOnReturn system preference."
         WHERE variable = 'finesMode'
     });
-    SetVersion( $DBversion );
-    print "Upgrade to $DBversion done (Bug 21633  - Remove finesMode 'test')\n";
+
+    NewVersion( $DBversion, 21633, 'Remove finesMode "test"');
 }
 
 $DBversion = '19.12.00.025';
@@ -20816,8 +20813,8 @@ if( CheckVersion( $DBversion ) ) {
         INSERT IGNORE INTO `systempreferences` (variable,value,options,explanation,type)
         VALUES ('DumpSearchQueryTemplate',0,'','Add the search query being passed to the search engine into the template for debugging','YesNo')
     });
-    SetVersion( $DBversion );
-    print "Upgrade to $DBversion done (Bug 24103 - add DumpSearchQueryTemplate syspref)\n";
+
+    NewVersion( $DBversion, 24103, 'add DumpSearchQueryTemplate syspref');
 }
 
 $DBversion = '19.12.00.026';
@@ -20826,8 +20823,7 @@ if( CheckVersion( $DBversion ) ) {
         $dbh->do( "ALTER TABLE z3950servers ADD COLUMN attributes VARCHAR(255) after add_xslt" );
     }
 
-    SetVersion( $DBversion );
-    print "Upgrade to $DBversion done (Bug 11297 - Add support for custom PQF attributes for Z39.50 server searches)\n";
+    NewVersion( $DBversion, 11297, 'Add support for custom PQF attributes for Z39.50 server searches');
 }
 
 $DBversion = '19.12.00.027';
@@ -20869,9 +20865,7 @@ if( CheckVersion( $DBversion ) ) {
         debit_type_code IS NOT NULL
     });
 
-    # Always end with this (adjust the bug info)
-    SetVersion( $DBversion );
-    print "Upgrade to $DBversion done (Bug 24532 - Fix pathological cases of negative debits)\n";
+    NewVersion( $DBversion, 24532, 'Fix pathological cases of negative debits');
 }
 
 $DBversion = '19.12.00.028';
@@ -20881,8 +20875,8 @@ if( CheckVersion( $DBversion ) ) {
         VALUES
         ('OpacBrowseSearch', '0',NULL, "Elasticsearch only: add a page allowing users to 'browse' all items in the collection",'YesNo')
     });
-    SetVersion( $DBversion );
-    print "Upgrade to $DBversion done (Bug 14567: Add OpacBrowseSearch syspref)\n";
+
+    NewVersion( $DBversion, 14567, 'Add OpacBrowseSearch syspref');
 }
 
 $DBversion = '19.12.00.029';
@@ -20891,8 +20885,7 @@ if( CheckVersion( $DBversion ) ) {
         $dbh->do('ALTER TABLE account_credit_types ADD COLUMN archived tinyint(1) NOT NULL DEFAULT 0 AFTER is_system');
     }
 
-    SetVersion( $DBversion );
-    print "Upgrade to $DBversion done (Bug 17702 - Add column account_credit_types.archived)\n";
+    NewVersion( $DBversion, 17702, 'Add column account_credit_types.archived');
 }
 
 $DBversion = '19.12.00.030';
@@ -20913,17 +20906,20 @@ if( CheckVersion( $DBversion ) ) {
     my ($opacheader) = $dbh->selectrow_array( q|
         SELECT value FROM systempreferences WHERE variable='opacheader';
     |);
+
+    my @detail;
     if( $opacheader ){
         foreach my $lang ( @langs ) {
-            print "Inserting opacheader contents into $lang news item...\n";
             # If there is a value in the opacheader preference, insert it into opac_news
             $dbh->do("INSERT INTO opac_news (branchcode, lang, title, content ) VALUES (NULL, ?, '', ?)", undef, "opacheader_$langs[0]", $opacheader);
+            push @detail, "Inserted opacheader contents into $lang news item...\n";
         }
     }
     # Remove the opacheader system preference
     $dbh->do("DELETE FROM systempreferences WHERE variable='opacheader'");
-    SetVersion ($DBversion);
-    print "Upgrade to $DBversion done (Bug 22880: Move contents of opacheader preference to Koha news system)\n";
+
+    unshift @detail, 'Move contents of opacheader preference to Koha news system';
+    NewVersion( $DBversion, 22880, \@detail);
 }
 
 $DBversion = '19.12.00.031';
@@ -20931,8 +20927,8 @@ if( CheckVersion( $DBversion ) ) {
     $dbh->do( q|
 ALTER TABLE article_requests MODIFY COLUMN created_on timestamp NULL, MODIFY COLUMN updated_on timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
     |);
-    SetVersion( $DBversion );
-    print "Upgrade to $DBversion done (Bug 22273: Column article_requests.created_on should not be updated)\n";
+
+    NewVersion( $DBversion, 22273, "Column article_requests.created_on should not be updated" );
 }
 
 $DBversion = '19.12.00.032';
@@ -20941,8 +20937,7 @@ if( CheckVersion( $DBversion ) ) {
         DELETE FROM systempreferences WHERE variable="UseQueryParser"
     |);
 
-    SetVersion( $DBversion );
-    print "Upgrade to $DBversion done (Bug 24735 - Remove UseQueryParser system preference)\n";
+    NewVersion( $DBversion, 24735, "Remove UseQueryParser system preference" );
 }
 
 $DBversion = '19.12.00.033';
@@ -20970,9 +20965,7 @@ if ( CheckVersion($DBversion) ) {
         (25, 'cashup', 'Perform cash register cashup action')
     });
 
-    SetVersion($DBversion);
-    print "Upgrade to $DBversion done (Bug 23355 - Add cash_register_actions table)\n";
-    print "Upgrade to $DBversion done (Bug 23355 - Add cash register cashup permissions)\n";
+    NewVersion( $DBversion, 23355, [ "Add cash_register_actions table", "Add cash register cashup permissions" ] );
 }
 
 $DBversion = '19.12.00.034';
@@ -21000,8 +20993,7 @@ if ( CheckVersion($DBversion) ) {
     }
     );
 
-    SetVersion($DBversion);
-    print "Upgrade to $DBversion done (Bug 24081 - Add DISCOUNT to account_credit_types and account_offset_types, Add accounts discount permission)\n";
+    NewVersion( $DBversion, 24081, "Add DISCOUNT to account_credit_types and account_offset_types, Add accounts discount permission");
 }
 
 $DBversion = '19.12.00.035';
@@ -21013,8 +21005,7 @@ if ( CheckVersion($DBversion) ) {
         (25, 'anonymous_refund', 'Perform refund actions from cash registers')
     });
 
-    SetVersion($DBversion);
-    print "Upgrade to $DBversion done (Bug 23442 - Add a refund option to the point of sale system)\n";
+    NewVersion( $DBversion, 23442, "Add a refund option to the point of sale system" );
 }
 
 $DBversion = '19.12.00.036';
@@ -21026,8 +21017,7 @@ if( CheckVersion( $DBversion ) ) {
             ('AccessControlAllowOrigin', '', NULL, 'Set the Access-Control-Allow-Origin header to the specified value', 'Free');
     });
 
-    SetVersion( $DBversion );
-    print "Upgrade to $DBversion done (Bug 24369 - Add CORS support to Koha)\n";
+    NewVersion( $DBversion, 24369, "Add CORS support to Koha");
 }
 
 $DBversion = '19.12.00.037';
@@ -21037,16 +21027,14 @@ if( CheckVersion( $DBversion ) ) {
     
     $dbh->do( q| INSERT IGNORE INTO systempreferences (variable, value, explanation, options, type) VALUES ('RenewAccruingItemWhenPaid', '0', 'If enabled, when the fines on an item accruing is paid off, attempt to renew that item. If the syspref "RenewalPeriodBase" is set to "due date", renewed items may still be overdue', '', 'YesNo'); | );
 
-    SetVersion( $DBversion );
-    print "Upgrade to $DBversion done (Bug 23051 - Add RenewAccruingItemInOpac syspref)\n";
-    print "Upgrade to $DBversion done (Bug 23051 - Add RenewAccruingItemWhenPaid syspref)\n";
+    NewVersion( $DBversion, 23051, [ "Add RenewAccruingItemInOpac syspref", "Add RenewAccruingItemWhenPaid syspref" ]);
 }
 
 $DBversion = '19.12.00.038';
 if( CheckVersion( $DBversion ) ) {
     $dbh->do( q| INSERT IGNORE INTO systempreferences (variable, value, explanation, options, type) VALUES ('CirculateILL', '0', 'If enabled, it is possible to circulate ILL requested items from within ILL', '', 'YesNo'); | );
-    SetVersion( $DBversion );
-    print "Upgrade to $DBversion done (Bug 23112  - Add CirculateILL syspref)\n";
+
+    NewVersion( $DBversion, 23112, "Add CirculateILL syspref");
 }
 
 $DBversion = '19.12.00.039';