From 11ae9fc956d93ca1a32c95ea9d1fdaa909c8df06 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Fri, 29 Mar 2019 12:20:26 +0000 Subject: [PATCH] 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 --- .../data/mysql/atomicupdate/bug_22564.perl | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 installer/data/mysql/atomicupdate/bug_22564.perl diff --git a/installer/data/mysql/atomicupdate/bug_22564.perl b/installer/data/mysql/atomicupdate/bug_22564.perl new file mode 100644 index 0000000000..0407ac8401 --- /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; +} -- 2.20.1