alby-hub/db
Roland ffee8cbcbe
feat: enable migration from postgres to sqlite (#2524)
Allows users running Alby Hub on postgres (e.g. Alby Cloud) to create a
migration file from Settings -> Migrate Alby Hub. The contents of the
postgres database are copied into a temporary local sqlite database
which is included in the migration file, so it can be imported into a
fresh sqlite-based hub.

- extract the db_migrate CLI copy logic into a shared db.MigrateDB
- also copy the swaps and forwards tables (previously silently dropped)
- only require VSS in the source when migrating to postgres
- show a hint on the migrate page when running on postgres
- show database storage type and VSS status on the about page
- don't log an error when removing non-existent db files before restore

Closes #2500

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-10 14:20:41 +07:00
..
migrations feat: track last settled transaction time for apps (#2214) 2026-04-09 16:26:45 +05:30
queries feat: suffix balance/amount fields with explicit unit (Sat or Msat) (#2153) 2026-04-17 13:53:28 +05:30
sqlite-wrapper Fix: sqlite connection parameters, add migrations to delete orphaned records and change postgres transaction amount to bigint (#1462) 2025-07-06 17:45:46 +07:00
test Fix: sqlite connection parameters, add migrations to delete orphaned records and change postgres transaction amount to bigint (#1462) 2025-07-06 17:45:46 +07:00
db.go Fix: sqlite connection parameters, add migrations to delete orphaned records and change postgres transaction amount to bigint (#1462) 2025-07-06 17:45:46 +07:00
db_migrate.go feat: enable migration from postgres to sqlite (#2524) 2026-08-10 14:20:41 +07:00
models.go chore: update to use sat/msat suffixes everywhere (#2271) 2026-05-01 15:41:56 +05:30