mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-17 19:03:42 +01:00
db: Add transaction_annotations table
This commit is contained in:
parent
3ca7150c03
commit
964156dc2d
12
wallet/db.c
12
wallet/db.c
@ -463,6 +463,18 @@ static struct migration dbmigrations[] = {
|
||||
{SQL("ALTER TABLE vars ADD COLUMN blobval BLOB"), NULL},
|
||||
{SQL("UPDATE vars SET intval = CAST(val AS INTEGER) WHERE name IN ('bip32_max_index', 'last_processed_block', 'next_pay_index')"), NULL},
|
||||
{SQL("UPDATE vars SET blobval = CAST(val AS BLOB) WHERE name = 'genesis_hash'"), NULL},
|
||||
{SQL("CREATE TABLE transaction_annotations ("
|
||||
/* Not making this a reference since we usually filter the TX by
|
||||
* walking its inputs and outputs, and only afterwards storing it in
|
||||
* the DB. Having a reference here would point into the void until we
|
||||
* add the matching TX. */
|
||||
" txid BLOB"
|
||||
", idx INTEGER" /* 0 when location is the tx, the index of the output or input otherwise */
|
||||
", location INTEGER" /* The transaction itself, the output at idx, or the input at idx */
|
||||
", type INTEGER"
|
||||
", channel BIGINT REFERENCES channels(id)"
|
||||
", UNIQUE(txid, idx)"
|
||||
");"), NULL},
|
||||
};
|
||||
|
||||
/* Leak tracking. */
|
||||
|
Loading…
Reference in New Issue
Block a user