feat(cc-052): migration 0009 — financial_signals table

This commit is contained in:
admin-valentin 2026-08-01 10:31:59 +00:00
parent 53eef93e84
commit ae7be88829

View file

@ -0,0 +1,26 @@
-- Migration 0009: Financial Intelligence — market signals table
-- Stores macro/FX/rates/news signals ingested from n8n (World Bank, IMF, Eurostat, DBnomics)
CREATE TABLE IF NOT EXISTS "financial_signals" (
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid(),
"tenant_id" uuid,
"category" text NOT NULL DEFAULT 'macro',
"region" text NOT NULL DEFAULT 'global',
"niche" text,
"source" text NOT NULL,
"indicator_code" text,
"title" text NOT NULL,
"summary" text NOT NULL,
"raw_value" numeric(18, 4),
"change_percent" numeric(10, 4),
"unit" text,
"severity" text NOT NULL DEFAULT 'info',
"published_at" timestamp NOT NULL DEFAULT now(),
"expires_at" timestamp,
"created_at" timestamp NOT NULL DEFAULT now()
);
CREATE INDEX IF NOT EXISTS "financial_signals_published_idx"
ON "financial_signals" ("category", "published_at" DESC);
CREATE INDEX IF NOT EXISTS "financial_signals_tenant_idx"
ON "financial_signals" ("tenant_id", "published_at" DESC);