invoices: add method to create payment hash index

Certain invoices may not have a deterministic payment hash. For such
invoices we still store the payment hashes in our KV database, but we do
not have a sufficient index to retrieve them. This PR adds such index to
the SQL database that will be used during migration to retrieve payment
hashes.
This commit is contained in:
Andras Banki-Horvath committed 2025-01-23 09:11:00 +01:00
1 parent be18f55ca1
commit 43797d6be7
2 files changed
+139

No files matched your search

+11
View File
@@ -123,6 +123,17 @@ type SQLInvoiceQueries interface { //nolint:interfacebloat
OnAMPSubInvoiceSettled(ctx context.Context,
arg sqlc.OnAMPSubInvoiceSettledParams) error
// Migration specific methods.
// TODO(bhandras): remove this once migrations have been separated out.
InsertKVInvoiceKeyAndAddIndex(ctx context.Context,
arg sqlc.InsertKVInvoiceKeyAndAddIndexParams) error
SetKVInvoicePaymentHash(ctx context.Context,
arg sqlc.SetKVInvoicePaymentHashParams) error
GetKVInvoicePaymentHashByAddIndex(ctx context.Context, addIndex int64) (
[]byte, error)
}
var _ InvoiceDB = (*SQLStore)(nil)