From 5bb2c9c8b8040242302e60533f0fa7cf650a1ee6 Mon Sep 17 00:00:00 2001 From: Jan Bader Date: Fri, 25 Feb 2022 15:27:06 +0000 Subject: [PATCH] Use empty string as fallback for TransferAccount --- postgres/queries/transactions.sql | 8 ++++---- postgres/transactions.sql.go | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/postgres/queries/transactions.sql b/postgres/queries/transactions.sql index b651da0..8ad3504 100644 --- a/postgres/queries/transactions.sql +++ b/postgres/queries/transactions.sql @@ -29,13 +29,13 @@ SELECT transactions.id, transactions.date, transactions.memo, COALESCE(payees.name, '') as payee, COALESCE(category_groups.name, '') as category_group, COALESCE(categories.name, '') as category, - ( + COALESCE(( SELECT CONCAT(otherAccounts.name) FROM transactions otherTransactions LEFT JOIN accounts otherAccounts ON otherAccounts.id = otherTransactions.account_id WHERE otherTransactions.group_id = transactions.group_id AND otherTransactions.id != transactions.id - )::text as transfer_account + ), '')::text as transfer_account FROM transactions INNER JOIN accounts ON accounts.id = transactions.account_id LEFT JOIN payees ON payees.id = transactions.payee_id @@ -51,13 +51,13 @@ SELECT transactions.id, transactions.date, transactions.memo, COALESCE(payees.name, '') as payee, COALESCE(category_groups.name, '') as category_group, COALESCE(categories.name, '') as category, - ( + COALESCE(( SELECT CONCAT(otherAccounts.name) FROM transactions otherTransactions LEFT JOIN accounts otherAccounts ON otherAccounts.id = otherTransactions.account_id WHERE otherTransactions.group_id = transactions.group_id AND otherTransactions.id != transactions.id - )::text as transfer_account + ), '')::text as transfer_account FROM transactions INNER JOIN accounts ON accounts.id = transactions.account_id LEFT JOIN payees ON payees.id = transactions.payee_id diff --git a/postgres/transactions.sql.go b/postgres/transactions.sql.go index cdf2e6f..e9bf8f8 100644 --- a/postgres/transactions.sql.go +++ b/postgres/transactions.sql.go @@ -87,13 +87,13 @@ SELECT transactions.id, transactions.date, transactions.memo, COALESCE(payees.name, '') as payee, COALESCE(category_groups.name, '') as category_group, COALESCE(categories.name, '') as category, - ( + COALESCE(( SELECT CONCAT(otherAccounts.name) FROM transactions otherTransactions LEFT JOIN accounts otherAccounts ON otherAccounts.id = otherTransactions.account_id WHERE otherTransactions.group_id = transactions.group_id AND otherTransactions.id != transactions.id - )::text as transfer_account + ), '')::text as transfer_account FROM transactions INNER JOIN accounts ON accounts.id = transactions.account_id LEFT JOIN payees ON payees.id = transactions.payee_id @@ -215,13 +215,13 @@ SELECT transactions.id, transactions.date, transactions.memo, COALESCE(payees.name, '') as payee, COALESCE(category_groups.name, '') as category_group, COALESCE(categories.name, '') as category, - ( + COALESCE(( SELECT CONCAT(otherAccounts.name) FROM transactions otherTransactions LEFT JOIN accounts otherAccounts ON otherAccounts.id = otherTransactions.account_id WHERE otherTransactions.group_id = transactions.group_id AND otherTransactions.id != transactions.id - )::text as transfer_account + ), '')::text as transfer_account FROM transactions INNER JOIN accounts ON accounts.id = transactions.account_id LEFT JOIN payees ON payees.id = transactions.payee_id