Skip to main content
The cloud uses Supabase PostgreSQL with Row Level Security (RLS) policies to enforce data isolation between teams.

Schema

Core tables

TableDescription
usersSynced from auth.users
teamsTeam records
team_membersMembership with roles (owner, admin, member)
api_tokensHashed API tokens with team scope

Data tables

TableDescription
tasksTeam-scoped tasks with status, priority, labels
task_commentsComments with author and body
contactsTeam-scoped contact profiles
contact_changesContact update audit trail

Email tables

TableDescription
email_oauth_tokensGmail OAuth tokens per team
email_watchesGmail Watch subscription state

Notification tables

TableDescription
device_tokensPush notification device registrations
notification_preferencesPer-user notification settings
notification_logPush delivery audit

System tables

TableDescription
event_queueSSE event buffer (cloud to service)
reminder_actionsReminder engine audit log

Row Level Security

Every data table has RLS policies that check team membership:
  • Users can only read and write data for teams they belong to
  • API tokens are scoped to a specific team via the X-Team-Id header
  • Policies use auth.uid() for web sessions and the verified token’s team for API access

Migrations

Database migrations are in supabase/migrations/ (files 001 through 018). Run them with the Supabase CLI:
supabase db push