Skip to content

Database schema

All tables live in the public schema. Managed by Alembic (SQLAlchemy 2.0 models).

ColumnTypeNotes
idUUIDPK
namevarchar(200)unique
settingsjsonbretention, redaction overrides, tz
created_attimestamptz
updated_attimestamptz
ColumnTypeNotes
idUUIDPK
emailvarchar(320)unique, citext-normalized
display_namevarchar(200)
password_hashtextargon2id PHC string
is_activebooleandefault true
created_attimestamptz
updated_attimestamptz
ColumnTypeNotes
idUUIDPK
user_idUUIDFK → users.id CASCADE
project_idUUIDFK → projects.id CASCADE
roleenum(owner, admin, operator, viewer)
created_attimestamptz

Unique on (user_id, project_id).

ColumnTypeNotes
idUUIDPK
project_idUUIDFK → projects.id CASCADE
namevarchar(200)unique with project_id
token_hashtextunique, HMAC-SHA256
protocol_versionvarchar(20)
framework_adaptervarchar(40)
engine_adapterstext[]
scheduler_adapterstext[]
capabilitiesjsonb
stateenum(online, offline, unknown)
last_seen_attimestamptz
last_connect_attimestamptz
metadatajsonb
created_attimestamptz
updated_attimestamptz

Indexes: (project_id, state), (last_seen_at).

ColumnTypeNotes
idUUIDPK
project_idUUIDFK → projects.id CASCADE
agent_idUUIDFK → agents.id SET NULL
enginevarchar(40)
namevarchar(500)
queuevarchar(200)
stateenumpending/started/succeeded/failed/cancelled/retried/lost
args_redactedjsonb
kwargs_redactedjsonb
errorjsonb{exc_type, exc_msg, traceback_redacted}
retried_asUUIDFK → tasks.id
group_idvarchar(200)Celery group_id / null
enqueued_attimestamptz
started_attimestamptz
finished_attimestamptz
created_attimestamptz
updated_attimestamptz

Indexes: (project_id, state), (project_id, name), (enqueued_at).

ColumnTypeNotes
idUUIDPK
task_idUUIDFK → tasks.id CASCADE
agent_idUUIDFK → agents.id SET NULL
event_typevarchar(40)task_sent/started/succeeded/failed/retry/cancelled/expired
tstimestamptzfrom agent clock
payloadjsonbredacted event data
created_attimestamptzbrain receipt time

Index: (task_id, ts).

ColumnTypeNotes
idUUIDPK
project_idUUIDFK → projects.id CASCADE
agent_idUUIDFK → agents.id SET NULL
schedulervarchar(40)
namevarchar(200)
taskvarchar(500)
schedule_typeenum(cron, interval, date)
expressionvarchar(200)cron string or interval spec
argsjsonb
kwargsjsonb
enabledboolean
last_run_attimestamptz
next_run_attimestamptz
metadatajsonb
created_attimestamptz
updated_attimestamptz
ColumnTypeNotes
idUUIDPK, ordered (ULIDs)
tstimestamptz
actor_user_idUUIDnullable (system events)
project_idUUIDnullable (global events)
actionvarchar(100)e.g. task.retry
target_typevarchar(40)
target_idUUID
detailsjsonb
row_hmacvarchar(64)hex-encoded HMAC-SHA256
prev_row_hmacvarchar(64)null for genesis

Index: (project_id, ts), (action).

ColumnTypeNotes
idUUIDPK
user_idUUIDFK → users.id CASCADE
expires_attimestamptzsliding; 14 days
datajsonbsession payload
created_attimestamptz
ColumnTypeNotes
idUUIDPK
project_idUUIDFK → projects.id CASCADE
emailvarchar(320)target
roleenumrole on accept
token_hashtextHMAC-SHA256
expires_attimestamptz72h from creation
accepted_attimestamptznull until accepted
created_byUUIDFK → users.id
created_attimestamptz
ColumnTypeNotes
idUUIDPK
user_idUUIDFK → users.id CASCADE
token_hashtext
expires_attimestamptz60 min
used_attimestamptznull until used
created_attimestamptz