lightning-terminal/db
Viktor Torstensson e955dc825b
multi: preserve action order across SQL migration
Migrate KV firewall actions by traversing the global actions-index
instead of iterating per-session buckets, so SQL action IDs follow the
same global creation order as the legacy KV store.

Also stabilize SQL action listing by ordering on created_at and id,
using id as a deterministic tie-breaker when multiple actions share the
same timestamp.

This is needed because KV actions have a real global sequence in
actions-index, while the old migration assigned SQL IDs based on bucket
traversal order. That could reorder legacy actions during migration.
Separately, ordering by created_at alone was not stable for equal
timestamps, so action queries could return different orders for the
same data.

NOTE: This commit explicitly edits the previous migration instead of
adding a new one. This is ok as SQL dbs are not yet supported in
production, so there are no live deployments to worry about.
2026-06-08 17:21:03 +02:00
..
migsets multi: deprecate kvdb stores after SQL migration 2026-05-14 11:39:14 +02:00
sqlc multi: preserve action order across SQL migration 2026-06-08 17:21:03 +02:00
sqlcmig6 multi: preserve action order across SQL migration 2026-06-08 17:21:03 +02:00
tombstone multi: deprecate kvdb stores after SQL migration 2026-05-14 11:39:14 +02:00
interfaces.go multi: remove unused db code 2026-05-14 11:37:52 +02:00
log.go multi: update LND and friends 2025-03-26 09:20:52 -05:00
migrations.go migstreams: rename package to migsets 2026-05-14 11:39:12 +02:00
postgres.go multi: rename MigrationStream names to MigrationSet 2026-05-14 11:39:09 +02:00
postgres_fixture.go db: SQL boilerplate code 2025-01-29 16:37:20 +02:00
schemas.go multi: introduce dev migrations 2026-05-14 11:38:30 +02:00
sqlerrors.go db: SQL boilerplate code 2025-01-29 16:37:20 +02:00
sqlite.go multi: remove unused db code 2026-05-14 11:37:52 +02:00