TurboJet
Database

Update schema

Edit Prisma schema, create migrations, push, and generate the client.

The database schema is defined in packages/database/prisma/schema.prisma. See the Prisma schema docs for full syntax.

Add or change a model

Example: a Post model related to User:

packages/database/prisma/schema.prisma
model Post {
  id        String   @id @default(cuid())
  title     String
  content   String
  author    User     @relation(fields: [authorId], references: [id])
  authorId  String
  createdAt DateTime @default(now())
  updatedAt DateTime @updatedAt

  @@map("post")
}

Also add the reverse relation on User (posts Post[]) when you introduce the model.

For a full product slice (schema → API → UI), see Build a feature.

Create and apply a migration using the direct connection (DIRECT_URL):

pnpm --filter @repo/database db:migrate
# or from the monorepo root:
pnpm prisma:migrate

The script runs prisma migrate dev with DATABASE_URL temporarily set to DIRECT_URL.

For CI and production deploys:

pnpm --filter @repo/database db:migrate:deploy

Push without a migration file

To sync the schema quickly in development without writing a migration:

pnpm --filter @repo/database db:push

This uses DATABASE_URL as-is (pooled URL is fine for local Docker).

Generate Prisma Client

After schema changes, regenerate the client:

pnpm --filter @repo/database db:generate

On this page