Database
Configure PostgreSQL and Prisma in the TanStack Start edition.
Set DATABASE_URL in .env to a PostgreSQL connection string. Authentication, organizations, billing and application data use the same database.
The schema is in prisma/schema.prisma; committed migrations are in prisma/migrations. Use npm run db:migrate:dev to create and apply a migration during development. npm run db:generate regenerates the Prisma client; it does not create a migration. Use npm run db:migrate to apply committed migrations in a fresh environment or deployment.
npm run db:migrate:dev
npm run db:studionpm run db:push is only for disposable local prototyping because it changes the database without producing migration history. Commit and review migration SQL before deploying schema changes. Keep tenant-owned queries scoped by organization ID: route-level membership checks do not replace authorization inside mutations or background work.