Persist Frankfurter EUR/DKK rates in currencies table

Store daily exchange rates in PostgreSQL with EUR/DKK cross rate.
Seed rates atom from DB on startup so WebSocket works immediately
even if Frankfurter is unreachable.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-06 12:16:53 +01:00
co-authored by Claude Opus 4.6
parent 146c3a4788
commit 11a1fc6b8f
5 changed files with 60 additions and 18 deletions
@@ -0,0 +1,7 @@
CREATE TABLE currencies (
rate_date DATE PRIMARY KEY,
eur NUMERIC(12,6) NOT NULL,
dkk NUMERIC(12,6) NOT NULL,
eur_dkk NUMERIC(12,6) NOT NULL,
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);