feat: complete Epic 1 production foundation
This commit is contained in:
1 parent
767428436d
commit
182bde8ac0
298 files changed
+35711
-5291
No files matched your search
@@ -0,0 +1,37 @@
|
||||
alter table approval_requests
|
||||
add column if not exists request_id text null;
|
||||
|
||||
alter table approval_requests
|
||||
add column if not exists trace_id text null;
|
||||
|
||||
alter table approval_requests
|
||||
add constraint approval_requests_request_id_check check (
|
||||
request_id is null
|
||||
or (
|
||||
octet_length(request_id) between 1 and 128
|
||||
and request_id !~ '[[:cntrl:],;]'
|
||||
)
|
||||
) not valid;
|
||||
|
||||
alter table approval_requests
|
||||
add constraint approval_requests_trace_id_check check (
|
||||
trace_id is null
|
||||
or (
|
||||
trace_id ~ '^[0-9a-f]{32}$'
|
||||
and trace_id <> '00000000000000000000000000000000'
|
||||
)
|
||||
) not valid;
|
||||
|
||||
create unique index if not exists approval_requests_pending_scope_fingerprint_idx
|
||||
on approval_requests(
|
||||
workspace_id,
|
||||
agent_id,
|
||||
operation_id,
|
||||
operation_version,
|
||||
request_fingerprint
|
||||
)
|
||||
where status = 'pending' and request_fingerprint is not null;
|
||||
|
||||
create index if not exists approval_requests_workspace_request_trace_idx
|
||||
on approval_requests(workspace_id, request_id, trace_id)
|
||||
where request_id is not null or trace_id is not null;
|
||||
Reference in new issue
Block a user