ER diagram · from schema.prisma

Team workspace database

Six tables behind a team-workspace SaaS: who belongs to which workspace, what lives in it, and how it pays.

Team workspace database Entity-relationship diagram of users, workspaces, memberships, projects, subscriptions and invoices, with column types, keys and crow’s-foot cardinality. OWNS CONTAINS HOLDS PAYS VIA MEMBERS ISSUES users User PK id uuid email UQ text name text avatar_url text? created_at timestamptz workspaces Workspace PK id uuid slug UQ text name text FK owner_id uuid created_at timestamptz projects Project PK id uuid FK workspace_id uuid name text archived_at timestamptz? memberships Membership PK id uuid FK user_id uuid FK workspace_id uuid role member_role joined_at timestamptz UNIQUE (user_id, workspace_id) subscriptions Subscription PK id uuid FK workspace_id UQ uuid plan plan_tier status sub_status seats int period_end timestamptz invoices Invoice PK id uuid FK subscription_id uuid amount_cents int currency char(3) status invoice_status issued_at timestamptz LEGEND exactly one zero or one one or many zero or many PK primary key FK foreign key UQ unique type? nullable Crow’s foot marks sit at the table they describe: one workspace has zero or many projects.