17 lines
621 B
SQL
17 lines
621 B
SQL
create table if not exists research_council_checkpoints (
|
|
id bigserial primary key,
|
|
run_id bigint null,
|
|
instrument_id bigint not null,
|
|
checkpoint_key text not null,
|
|
status text not null,
|
|
stage text not null,
|
|
payload jsonb not null default '{}'::jsonb,
|
|
created_ts timestamptz not null,
|
|
updated_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_checkpoints_latest
|
|
on research_council_checkpoints (instrument_id, checkpoint_key, updated_ts desc, id desc);
|