lnd/sqldb/sqlc/migrations/000002_amp_invoices.down.sql
positiveblue eda95e6607
sqldb: add AMP invoices SQL schema
Schema for AMP invocies.

AMP invoices can be paid multiple times and each payment to an AMP invoice
is identified by a `set_id`.

The A in AMP stands for `Atomic`. All the htlcs belonging to the same
AMP payment (share the same set_id) will be resolved at the same time
with the same result: settled/canceled.

AMP invoices do not have an "invoice preimage". Instead, each htcl has
its own hash/preimage. When a new htlc is added the hash for that htlc
is attached to it. When all the htlcs of a set_id have been received we
are able to compute the preimage for each one of them.
2023-07-10 17:53:56 -07:00

8 lines
277 B
SQL

DROP INDEX IF EXISTS amp_htlcs_htlc_id_idx;
DROP INDEX IF EXISTS amp_htlcs_invoice_id_idx;
DROP INDEX IF EXISTS amp_htlcs_set_id_idx;
DROP TABLE IF EXISTS amp_invoice_htlcs;
DROP INDEX IF EXISTS amp_invoice_payments_invoice_id_idx;
DROP TABLE IF EXISTS amp_invoice_payments;