From daeec66bd7815d73f0e00b8610bd024d54be7ba8 Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Thu, 9 Jun 2022 18:14:01 +0200 Subject: [PATCH] db: Add completed_at field to payments We'll want to use these to track durations for `sendpays` and `pays`. --- wallet/db.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wallet/db.c b/wallet/db.c index a0fd0e8da786..b3a5a248aaec 100644 --- a/wallet/db.c +++ b/wallet/db.c @@ -883,6 +883,9 @@ static struct migration dbmigrations[] = { * in routehints in invoices. The peer will remember all the * aliases, but we only ever need one. */ {SQL("ALTER TABLE channels ADD alias_remote BIGINT DEFAULT NULL"), NULL}, + /* Cheeky immediate completion as best effort approximation of real completion time */ + {SQL("ALTER TABLE payments ADD completed_at INTEGER DEFAULT NULL;"), NULL}, + {SQL("UPDATE payments SET completed_at = timestamp WHERE status != 0;"), NULL} }; /**