payments/db: split migration queries into dedicated SQLMigrationQueries interface

This commit is contained in:
ziggie committed 2026-02-25 18:52:34 +01:00
1 parent a2c36d1667
commit cf3610abb9
5 files changed
+30 -18

No files matched your search

+9 -6
View File
@@ -89,13 +89,16 @@ type SQLQueries interface {
// DeleteFailedAttempts removes all failed HTLCs from the db for a
// given payment.
DeleteFailedAttempts(ctx context.Context, paymentID int64) error
}
/*
Migration specific queries.
These queries are used ONLY for the one-time migration from KV
to SQL.
*/
// SQLMigrationQueries extends SQLQueries with the additional queries needed
// for the one-time migration from KV to SQL. Keeping them in a separate
// interface makes it clear which code paths are migration-only and prevents
// the regular store from accidentally depending on them.
//
//nolint:ll
type SQLMigrationQueries interface {
SQLQueries
// FetchPaymentsByIDsMig is a migration-only batch fetch that returns
// payment data along with HTLC attempt counts for structural