Finalise account tests

This commit is contained in:
James Cole
2019-06-23 05:53:01 +02:00
parent 311659ba0d
commit 9f50c5db3d
25 changed files with 470 additions and 841 deletions

View File

@@ -61,6 +61,7 @@ class RenameAccountMeta extends Command
$array = [
'accountRole' => 'account_role',
'ccType' => 'cc_type',
'accountNumber' => 'account_number',
'ccMonthlyPaymentDate' => 'cc_monthly_payment_date',
];
$count = 0;
@@ -71,6 +72,9 @@ class RenameAccountMeta extends Command
*/
foreach ($array as $old => $new) {
$count += AccountMeta::where('name', $old)->update(['name' => $new]);
// delete empty entries while we're at it.
AccountMeta::where('name', $new)->where('data','""')->delete();
}
$this->markAsExecuted();