The parent app uses Prisma with PostgreSQL, and several major product systems rely directly on the schema shape.
src/lib/prisma.ts uses the standard Prisma singleton pattern to avoid creating too many clients during development.
Two of the most important design choices are Profile.id matching the Supabase user ID and organization-level billing being stored separately from profile-level billing.
The project build also runs prisma generate, and postinstall does the same after package installation.
npx prisma generate
npx prisma migrate devIf billing behaves incorrectly after checkout, these are the first tables to inspect.
Run this before turning on app subscriptions in production.
npx prisma migrate deploy