Database Reference

This page lists Track's domain tables. All tables live in your own Supabase project — not ARK's. Row-Level Security is enabled on every table; policies scope rows to the user's workspace.

Shared platform tables

These are shared with other ARK products if you run Track in the same Supabase project.

TablePurpose
profilesExtends auth.users with name, avatar, workspace role.
workspacesTop-level tenant boundary.
workspace_membersJoin table: user ↔ workspace with role.
audit_logWho did what and when.

Track domain tables

boards

One row per pipeline.

ColumnTypeNotes
iduuid PK
workspace_iduuid FK → workspaces
nametext
record_typetextcontact, company, or deal.
is_archivedbool
created_byuuid FK → auth.users
created_attimestamptz

board_stages

Columns on a board.

ColumnTypeNotes
iduuid PK
board_iduuid FK → boards
nametext
positionintOrdering.
stage_typetextopen, won, lost.
probabilitynumeric0–100, optional.

board_cards

A card on a board — references the underlying record.

ColumnTypeNotes
iduuid PK
board_iduuid FK → boards
stage_iduuid FK → board_stages
record_typetextMatches the board's.
record_iduuidFK to contacts/companies/deals (soft).
positionintOrdering within a stage.

contacts

Person records.

ColumnTypeNotes
iduuid PK
workspace_iduuid FK → workspaces
name, email, phone, titletext
company_iduuid FK → companiesNullable.
owner_iduuid FK → auth.usersNullable.
tagstext[]
custom_fieldsjsonbValidated at app layer.
deleted_attimestamptzSoft delete.

companies

Organization records.

ColumnTypeNotes
iduuid PK
workspace_iduuid FK → workspaces
name, domain, industry, sizetext
parent_iduuid FK → companiesNullable.
owner_iduuid FK → auth.users
custom_fieldsjsonb
deleted_attimestamptz

deals

Opportunity records.

ColumnTypeNotes
iduuid PK
workspace_iduuid FK → workspaces
nametext
value_centsbigintMinor units.
currencytextISO 4217.
stage_iduuid FK → board_stages
close_datedate
probabilitynumeric
primary_contact_iduuid FK → contacts
company_iduuid FK → companies
owner_iduuid FK → auth.users
custom_fieldsjsonb
deleted_attimestamptz

deal_contacts

Many-to-many between deals and contacts (besides the primary).

ColumnTypeNotes
deal_iduuid FK → deals
contact_iduuid FK → contacts
roletextFree-form (decision-maker, champion, etc.).

timeline_entries

Notes, calls, emails, and auto-logged events on records.

ColumnTypeNotes
iduuid PK
workspace_iduuid FK → workspaces
record_typetextcontact, company, deal.
record_iduuid
entry_typetextnote, call, email, meeting, stage_change, field_edit, task.
author_iduuid FK → auth.users
bodytextMarkdown for notes; structured JSON in payload for typed events.
payloadjsonbType-specific details.
created_attimestamptz

tasks

Actionable todos tied to records.

ColumnTypeNotes
iduuid PK
workspace_iduuid FK → workspaces
record_type, record_idtext, uuidParent record.
title, descriptiontext
assigned_touuid FK → auth.users
due_datedate
statustextopen, in_progress, done.
source_entry_iduuid FK → timeline_entriesNullable.

custom_fields

Schema for user-defined fields.

ColumnTypeNotes
iduuid PK
workspace_iduuid FK → workspaces
record_typetextcontact, company, deal.
nametextUI label.
keytextStable key used in custom_fields jsonb.
typetexttext, number, date, select, multi_select, boolean, url, currency, link.
configjsonbType-specific (options, validation rules).
searchableboolIncluded in full-text index.

automations

User-defined automation rules.

ColumnTypeNotes
iduuid PK
workspace_iduuid FK → workspaces
nametext
triggerjsonb{type, params}.
conditionsjsonbArray of filter predicates.
actionsjsonbArray of action definitions.
is_enabledbool

automation_runs

Execution log.

ColumnTypeNotes
iduuid PK
automation_iduuid FK → automations
record_iduuid
statustextsuccess, failed.
duration_msint
errortextNull on success.
run_attimestamptz

search_index

Materialized search vectors.

ColumnTypeNotes
iduuid PK
workspace_iduuid FK → workspaces
record_typetext
record_iduuid
tsvtsvectorGIN-indexed.
trigramtextpg_trgm fuzzy fallback.

Relationships at a glance

workspaces
 ├─ boards
 │   └─ board_stages
 │       └─ board_cards ──► contacts / companies / deals
 ├─ contacts ──► companies (optional)
 ├─ companies
 ├─ deals ──► contacts (primary + deal_contacts)
 │       └─ board_stages
 ├─ timeline_entries (polymorphic on record)
 ├─ tasks (polymorphic on record)
 ├─ custom_fields (per record_type)
 ├─ automations
 │   └─ automation_runs
 └─ search_index (polymorphic)

Row-Level Security summary

  • Every domain table has a policy: workspace_id = user's workspace.
  • auth.uid() is resolved at query time.
  • The admin client (service role) bypasses RLS — used only by Edge Functions that legitimately need cross-workspace access (the automation runner, the webhook dispatcher). See CLAUDE.md in your Track repo for the security rules that enforce this.