From bd6ccad5d9b78719241d06a96a7ac0b77cabcef1 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Mon, 11 May 2020 11:33:32 +0100 Subject: [PATCH] Bug 25389: Catch LOST_RETURNED in DB update 19.12.00.021 An errant update from bug 22563 could lead to cases of LOST_RETURNED as aposed to LOST_RETURN as an account_credit_type. This patch adds code to deal with those cases to the update for bug 24592 Signed-off-by: Kyle M Hall Signed-off-by: Jonathan Druart Signed-off-by: Martin Renvoize --- installer/data/mysql/updatedatabase.pl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index e12471c6a7..5bbef648d2 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -20755,6 +20755,8 @@ if( CheckVersion( $DBversion ) ) { credit_type_code = 'LOST_FOUND' WHERE credit_type_code = 'LOST_RETURN' + OR + credit_type_code = 'LOST_RETURNED' }); # Migrate LOST + RETURNED to LOST + FOUND @@ -20770,6 +20772,11 @@ if( CheckVersion( $DBversion ) ) { }); # Drop LOST_RETURNED credit type + $dbh->do(qq{ + DELETE FROM account_credit_types WHERE code = 'LOST_RETURNED' + }); + + # Drop LOST_RETURN credit type $dbh->do(qq{ DELETE FROM account_credit_types WHERE code = 'LOST_RETURN' }); -- 2.39.5