@@ -, +, @@ --- .../mysql/atomicupdate/bug_23805_credit.perl | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) --- a/installer/data/mysql/atomicupdate/bug_23805_credit.perl +++ a/installer/data/mysql/atomicupdate/bug_23805_credit.perl @@ -101,6 +101,27 @@ if ( CheckVersion($DBversion) ) { } ); + # Add any unexpected accounttype codes to credit_types as appropriate + $dbh->do( + qq{ + INSERT IGNORE INTO account_credit_types ( + code, + description, + can_be_added_manually, + is_system + ) + SELECT + SUBSTR(accounttype, 1, 80), + "Unexpected type found during upgrade", + 1, + 0 + FROM + accountlines + WHERE + amount < 0 + } + ); + # Populating credit_type_code $dbh->do( qq{ --