From c74835659b1895401f4c9fb9fb538cdb0af337e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20Salgado?= Date: Thu, 9 Sep 2021 18:00:18 +0100 Subject: [PATCH] fix: SQL boolean and nullable value comparison --- lib/tx.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/tx.js b/lib/tx.js index 52a39906..8db3424f 100644 --- a/lib/tx.js +++ b/lib/tx.js @@ -75,7 +75,8 @@ function customerHistory (customerId, thresholdDays) { FROM cash_out_txs txOut WHERE txOut.customer_id = $1 AND txOut.created > now() - interval $2 - AND (timedout = true OR error_code != 'operatorCancel') + AND timedout IS false + AND error_code IS DISTINCT FROM 'operatorCancel' AND fiat > 0 ORDER BY created;`