Files
btcdata/resources/migrations/20260306200000-create-currencies.up.sql
magnusandClaude Opus 4.6 11a1fc6b8f 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>
2026-03-06 12:16:53 +01:00

8 lines
208 B
SQL

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()
);