mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
db: add min/max commitnum fields to channel_htlcs.
And initialize max to current height max when htlcs are already dead. Turns out (thanks CI!) that MAX() of multiple columns is GREATEST() in Postgres. That's clearer (MAX is used elsewhere for single columns), so translate on the sqlite3 side. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
Christian Decker
parent
bdaec48400
commit
36b66871a2
@@ -43,6 +43,8 @@ class Sqlite3Rewriter(Rewriter):
|
||||
r'INSERT INTO[ \t]+(.*)[ \t]+ON CONFLICT.*DO NOTHING;': 'INSERT OR IGNORE INTO \\1;',
|
||||
# Rewrite "decode('abcd', 'hex')" to become "x'abcd'"
|
||||
r'decode\((.*),\s*[\'\"]hex[\'\"]\)': 'x\\1',
|
||||
# GREATEST() of multiple columns is simple MAX in sqlite3.
|
||||
r'GREATEST\(([^)]*)\)': "MAX(\\1)",
|
||||
}
|
||||
return self.rewrite_types(query, typemapping)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user