mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-02-23 22:46:40 +01:00
This is the schema for "ordinal" BOLT11 invoices. The invoices table aims to keep an entry for each invoice, BOLT11 or not, that will be supported. Invoice related HTLCs will be stored in a separete table than forwarded htlcs. SQLite does not support `SEQUENCE`. We achieve atomic autoincrementals using primary keys with autoincrement/serial. An invoice `AddIndex` translates to `invoices(id)` while `SettleIndex` is `invoice_payments(id)`.
19 lines
691 B
SQL
19 lines
691 B
SQL
DROP INDEX IF EXISTS invoice_payments_invoice_id_idx;
|
|
DROP INDEX IF EXISTS invoice_payments_settled_at_idx;
|
|
DROP TABLE IF EXISTS invoice_payments;
|
|
|
|
DROP INDEX IF EXISTS invoice_htlc_custom_records_htlc_id_idx;
|
|
DROP TABLE IF EXISTS invoice_htlc_custom_records;
|
|
|
|
DROP INDEX IF EXISTS invoice_htlc_invoice_id_idx;
|
|
DROP TABLE IF EXISTS invoice_htlcs;
|
|
|
|
DROP INDEX IF EXISTS invoice_feature_invoice_id_idx;
|
|
DROP TABLE IF EXISTS invoice_features;
|
|
|
|
DROP INDEX IF EXISTS invoices_created_at_idx;
|
|
DROP INDEX IF EXISTS invoices_state_idx;
|
|
DROP INDEX IF EXISTS invoices_payment_addr_idx;
|
|
DROP INDEX IF EXISTS invoices_preimage_idx;
|
|
DROP INDEX IF EXISTS invoices_hash_idx;
|
|
DROP TABLE IF EXISTS invoices;
|