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 <martin.renvoize@ptfs-europe.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This commit is contained in:
Martin Renvoize 2019-03-29 12:20:26 +00:00 committed by Nick Clemens
parent b3de8738b7
commit d8dfb61a90
1 changed files with 17 additions and 0 deletions

View File

@ -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;
}