From: Martin Renvoize Date: Fri, 29 Mar 2019 12:20:26 +0000 (+0000) Subject: Bug 22564: Add database update 'just in case' X-Git-Tag: v19.05.00~359 X-Git-Url: http://git.equinoxoli.org/?p=koha.git;a=commitdiff_plain;h=d8dfb61a9099cd9c07b22bf1d5a4cc2a834f2fc6 Bug 22564: Add database update 'just in case' With the introduction of the 'status' field it's a clear oportunity to convert any last remaining instances of 'Rep' to 'L' + 'REPLACED'. Signed-off-by: Martin Renvoize Signed-off-by: Josef Moravec Signed-off-by: Marcel de Rooy Signed-off-by: Nick Clemens --- diff --git a/installer/data/mysql/atomicupdate/bug_22564.perl b/installer/data/mysql/atomicupdate/bug_22564.perl new file mode 100644 index 0000000..0407ac8 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_22564.perl @@ -0,0 +1,17 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if ( CheckVersion($DBversion) ) { + + my $rows = $dbh->do( + qq{ + UPDATE `accountlines` + SET + `accounttype` = 'L', + `status` = 'REPLACED' + WHERE + `accounttype` = 'Rep' + } + ); + + SetVersion($DBversion); + printf "Upgrade to $DBversion done (Bug 22564 - Fix accounttype 'O' to 'FU' - %d updated)\n", $rows; +}