21 lines
785 B
SQL
21 lines
785 B
SQL
create table if not exists research_council_runs (
|
|
id bigserial primary key,
|
|
instrument_id bigint not null,
|
|
trading_plan_id bigint null,
|
|
candidate_id bigint null,
|
|
signal_id bigint null,
|
|
decision_packet_id bigint null,
|
|
status text not null,
|
|
timeframe text not null default '1m',
|
|
model_code text not null,
|
|
committee_confidence double precision not null default 0,
|
|
summary_text text not null default '',
|
|
payload jsonb not null default '{}'::jsonb,
|
|
generated_ts timestamptz not null,
|
|
created_at timestamptz not null default now(),
|
|
updated_at timestamptz not null default now()
|
|
);
|
|
|
|
create index if not exists idx_research_council_runs_instrument_generated
|
|
on research_council_runs (instrument_id, generated_ts desc, id desc);
|