18 lines
754 B
SQL
18 lines
754 B
SQL
create table if not exists decision_assistant_workflow_history (
|
|
id bigserial primary key,
|
|
profile_key varchar(64) not null default 'local_operator',
|
|
instrument_id bigint not null,
|
|
current_session varchar(32),
|
|
next_phase varchar(32),
|
|
next_artifact_kind varchar(64),
|
|
snapshot_signature varchar(128) not null,
|
|
payload jsonb not null default '{}'::jsonb,
|
|
created_ts timestamptz not null default now()
|
|
);
|
|
|
|
create index if not exists idx_decision_assistant_workflow_history_instrument_ts
|
|
on decision_assistant_workflow_history (instrument_id, created_ts desc);
|
|
|
|
create index if not exists idx_decision_assistant_workflow_history_signature
|
|
on decision_assistant_workflow_history (instrument_id, snapshot_signature);
|