Connecting
Learn/L15 · Your stack (VPS repos)

Reading schema.ts (your database map)

schema.ts lists tables, field types, and indexes — the contract for all data.

Difficulty 2/5

Plain English

Open convex/schema.ts. Each defineTable is a spreadsheet with rules. Indexes (by_tenant, by_email) tell Convex how to find rows fast.

Analogy

Schema is the building blueprint; mutations are who may move furniture in.

Jessica's wedding portal

convex/schema.ts uses organizationId on most tables — multi-tenant like Agentify's tenantId.

Agentify CRM

Large schema split under convex/schema/ and domains/* — start from schema.ts imports.

Go deeper

Table = kind of record. Index = fast lookup path.

Common mistakes

  • Adding fields without updating validators in mutations.
  • Querying without an index on huge tables.

AI-agent trap

Creating tables that already exist with different shapes — grep schema first.

Summary

Changing schema requires convex push; breaking changes need migrations (@convex-dev/migrations in agentify).

Confidence: