-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathschema.sql
More file actions
58 lines (52 loc) · 1.88 KB
/
schema.sql
File metadata and controls
58 lines (52 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
-- CivAgent Supabase schema
-- Run this in Supabase Dashboard -> SQL Editor before starting real agent runs.
create table if not exists public.agent_runs (
id text primary key,
workspace_id text not null,
created_at timestamptz not null,
status text not null,
model text not null,
integrations jsonb not null,
profile jsonb not null,
result jsonb not null,
markdown_report text not null
);
create table if not exists public.agent_artifacts (
id text primary key,
run_id text not null references public.agent_runs(id) on delete cascade,
created_at timestamptz not null,
artifact_type text not null,
title text not null,
content jsonb not null
);
create table if not exists public.agent_sources (
id text primary key,
run_id text not null references public.agent_runs(id) on delete cascade,
created_at timestamptz not null,
provider text not null,
title text not null,
url text not null,
snippet text not null
);
create table if not exists public.tool_calls (
id text primary key,
run_id text not null references public.agent_runs(id) on delete cascade,
created_at timestamptz not null,
tool_name text not null,
status text not null,
input jsonb not null,
output jsonb not null
);
create table if not exists public.approvals (
id text primary key,
run_id text not null references public.agent_runs(id) on delete cascade,
created_at timestamptz not null,
title text not null,
policy text not null,
required boolean not null default true
);
create index if not exists idx_agent_runs_created on public.agent_runs(created_at desc);
create index if not exists idx_agent_artifacts_run on public.agent_artifacts(run_id);
create index if not exists idx_agent_sources_run on public.agent_sources(run_id);
create index if not exists idx_tool_calls_run on public.tool_calls(run_id);
create index if not exists idx_approvals_run on public.approvals(run_id);