mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-02-24 22:58:18 +01:00
This commit attempts to fix some issues with the invoice store's schema that we couldn't foresee before the implementation was finished. This is safe as the schema has not been instantiated yet outside of unit tests. Furthermore the commit updates invoice store SQL queries according to fixes in the schema as well as to prepare the higher level implementation in the upcoming commits.
41 lines
817 B
SQL
41 lines
817 B
SQL
-- name: OnInvoiceCreated :exec
|
|
INSERT INTO invoice_events (
|
|
added_at, event_type, invoice_id
|
|
) VALUES (
|
|
$1, 0, $2
|
|
);
|
|
|
|
-- name: OnInvoiceCanceled :exec
|
|
INSERT INTO invoice_events (
|
|
added_at, event_type, invoice_id
|
|
) VALUES (
|
|
$1, 1, $2
|
|
);
|
|
|
|
-- name: OnInvoiceSettled :exec
|
|
INSERT INTO invoice_events (
|
|
added_at, event_type, invoice_id
|
|
) VALUES (
|
|
$1, 2, $2
|
|
);
|
|
|
|
-- name: OnAMPSubInvoiceCreated :exec
|
|
INSERT INTO invoice_events (
|
|
added_at, event_type, invoice_id, set_id
|
|
) VALUES (
|
|
$1, 3, $2, $3
|
|
);
|
|
|
|
-- name: OnAMPSubInvoiceCanceled :exec
|
|
INSERT INTO invoice_events (
|
|
added_at, event_type, invoice_id, set_id
|
|
) VALUES (
|
|
$1, 4, $2, $3
|
|
);
|
|
|
|
-- name: OnAMPSubInvoiceSettled :exec
|
|
INSERT INTO invoice_events (
|
|
added_at, event_type, invoice_id, set_id
|
|
) VALUES (
|
|
$1, 5, $2, $3
|
|
);
|