From 6eb9c5d9eec2efdc0b461c27586822c05a60c325 Mon Sep 17 00:00:00 2001 From: callebtc <93376500+callebtc@users.noreply.github.com> Date: Tue, 6 Dec 2022 21:04:10 +0100 Subject: [PATCH] better sort sql clause --- lnbits/core/migrations.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lnbits/core/migrations.py b/lnbits/core/migrations.py index 9c237349..eabe5a7c 100644 --- a/lnbits/core/migrations.py +++ b/lnbits/core/migrations.py @@ -216,9 +216,10 @@ async def m007_set_invoice_expiries(db): SELECT bolt11, checking_id FROM apipayments WHERE pending = true + AND amount > 0 AND bolt11 IS NOT NULL AND expiry IS NULL - AND amount > 0 AND time < {db.timestamp_now} + AND time < {db.timestamp_now} """ ) ).fetchall()