diff --git a/infra/migrations/032_seed_default_risk_config.sql b/infra/migrations/032_seed_default_risk_config.sql new file mode 100644 index 0000000..077edbe --- /dev/null +++ b/infra/migrations/032_seed_default_risk_config.sql @@ -0,0 +1,12 @@ +-- Seed a default risk_configs row with all signal layers explicitly enabled. +-- This ensures fresh deployments have macro and competitive layers active +-- without requiring manual API calls or DB patches. +-- Idempotent: skips if an active config already exists. + +INSERT INTO risk_configs (name, trading_mode, config, active) +SELECT 'default', 'paper', + '{"macro_enabled": true, "competitive_enabled": true}'::jsonb, + TRUE +WHERE NOT EXISTS ( + SELECT 1 FROM risk_configs WHERE active = TRUE +);