Phase 6 execution tickets

This commit is contained in:
Codex
2026-05-06 16:03:40 +08:00
parent bc689195bd
commit c3cb2e944f
15 changed files with 928 additions and 3 deletions
@@ -0,0 +1,23 @@
create table if not exists execution_tickets (
id bigserial primary key,
signal_id bigint not null references trade_signals(id),
execution_mode text not null,
status text not null,
created_ts timestamptz not null,
expires_ts timestamptz,
confirmed_by text,
confirmed_at timestamptz,
execution_id bigint references trade_executions(id),
ticket_snapshot jsonb not null default '{}'::jsonb,
created_at timestamptz not null default now(),
updated_at timestamptz not null default now()
);
create index if not exists idx_execution_tickets_signal_created_desc
on execution_tickets (signal_id, created_ts desc);
create index if not exists idx_execution_tickets_status_created_desc
on execution_tickets (status, created_ts desc);
create index if not exists idx_execution_tickets_execution_id
on execution_tickets (execution_id);