From f99212a26bd4ff12a6f858110c271f7c32f99a97 Mon Sep 17 00:00:00 2001 From: Paul Nicolas Date: Wed, 21 Feb 2024 17:02:33 +0100 Subject: [PATCH] fix(payments): balances conflict do nothing --- components/payments/cmd/connectors/internal/storage/balances.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/payments/cmd/connectors/internal/storage/balances.go b/components/payments/cmd/connectors/internal/storage/balances.go index 473f361da0..a58e75d49c 100644 --- a/components/payments/cmd/connectors/internal/storage/balances.go +++ b/components/payments/cmd/connectors/internal/storage/balances.go @@ -36,6 +36,8 @@ func (s *Storage) InsertBalances(ctx context.Context, balances []*models.Balance ) data`) } + query = query.On("CONFLICT (account_id, created_at, currency) DO NOTHING") + _, err := query.Exec(ctx) if err != nil { return e("failed to create balances", err)