paymentsdb: fix duplicate interface check and down migration drop order

- Remove duplicate compile-time interface assertion for SQLStore.

- Fix the down migration to drop payment_intents before payments to
respect the foreign key dependency order. This was not a bug in the
first place bc we have the CASCADE when deleting payments.
This commit is contained in:
ziggie committed 2026-02-25 18:36:14 +01:00
1 parent 216de55dff
commit e9a88267ff
2 files changed
+8 -11

No files matched your search

-3
View File
@@ -132,9 +132,6 @@ func NewSQLStore(cfg *SQLStoreConfig, db BatchedSQLQueries,
}, nil
}
// A compile-time constraint to ensure SQLStore implements DB.
var _ DB = (*SQLStore)(nil)
// fetchPaymentWithCompleteData fetches a payment with all its related data
// including attempts, hops, and custom records from the database.
// This is a convenience wrapper around the batch loading functions for single
@@ -39,16 +39,16 @@ DROP INDEX IF EXISTS idx_htlc_payment_hash;
DROP INDEX IF EXISTS idx_htlc_attempt_time;
DROP TABLE IF EXISTS payment_htlc_attempts;
-- ─────────────────────────────────────────────
-- Drop payments table and its indexes.
-- ─────────────────────────────────────────────
DROP INDEX IF EXISTS idx_payments_created_at;
DROP TABLE IF EXISTS payments;
-- ─────────────────────────────────────────────
-- Drop payment intents table and its indexes.
-- ─────────────────────────────────────────────
DROP INDEX IF EXISTS idx_payment_intents_type;
DROP TABLE IF EXISTS payment_intents;
DROP TABLE IF EXISTS payment_intents;
-- ─────────────────────────────────────────────
-- Drop payments table and its indexes.
-- ─────────────────────────────────────────────
DROP INDEX IF EXISTS idx_payments_created_at;
DROP TABLE IF EXISTS payments;