feat(cc-052): migration 0009 — financial_signals table
This commit is contained in:
parent
53eef93e84
commit
ae7be88829
1 changed files with 26 additions and 0 deletions
26
drizzle/0009_financial_intelligence.sql
Normal file
26
drizzle/0009_financial_intelligence.sql
Normal 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);
|
||||
Loading…
Reference in a new issue