Skip to content

Database tables for workspaces and changes

This page lists the columns of workspaces, worktrees, file_changes, unlisted_changes and pushes. Database tables says how to read the columns.

One folder on a machine for a task, with a clone of each of the task’s repos.

Column Type Notes
id uuid key
team_id uuid references teams
task_id uuid references tasks
instance_id uuid references instances
path text
status text default 'creating'; one of creating, ready, removed
created_at timestamptz default now()

A repo cloned into a workspace, with its branch and the commit the branch started from.

Column Type Notes
workspace_id uuid references workspaces
repo_id uuid references repos
branch text
base_commit text optional

Primary key (workspace_id, repo_id).

Each file that differs from the base branch in one of a workspace’s repos, as the workspace’s machine last saw it. A row goes once its file no longer differs, so the table is the current state, not a history.

Column Type Notes
id uuid key
team_id uuid references teams
task_id uuid references tasks
workspace_id uuid references workspaces
repo_id uuid references repos
path text
status text one of added, modified, deleted
additions integer default 0
deletions integer default 0
preview text one of text, binary, too_large
content text optional
diff text optional
base_commit text
hash text
updated_at timestamptz default now()

Unique (workspace_id, repo_id, path). Check (((preview = 'text') AND (status <> 'deleted')) = (content IS NOT NULL)). Check ((preview = 'text') = (diff IS NOT NULL)). Check (additions >= 0). Check (deletions >= 0).

A repo of a workspace whose changes the machine could not list, because more files differ than it lists or git failed to read the repo. The row goes once the repo is listed again.

Column Type Notes
workspace_id uuid references workspaces
repo_id uuid references repos
team_id uuid references teams
task_id uuid references tasks
kind text one of too_many, unreadable
reason text optional
updated_at timestamptz default now()

Primary key (workspace_id, repo_id). Check ((kind = 'unreadable') = (reason IS NOT NULL)).

A request to push a task’s branches and open its pull requests. The push command pushes, the runner opens the pull requests once it ends, and they become link artifacts on the task.

Column Type Notes
id uuid key
team_id uuid references teams
task_id uuid references tasks
workspace_id uuid references workspaces
command_id uuid optional; references commands
requested_by uuid optional; references people
title text
body text
status text default 'pushing'; one of pushing, done, failed
error text optional
created_at timestamptz default now()
finished_at timestamptz optional
attempt_id uuid optional; references task_attempts

Unique (task_id) where (status = 'pushing'). Check ((status = 'failed') = (error IS NOT NULL)). Check ((status = 'pushing') = (finished_at IS NULL)).