Labsco
prisma logo

prisma-upgrade-v7-schema-changes

✓ Official8

by prisma · part of prisma/cursor-plugin

Schema Changes. Reference when using this Prisma feature.

🔥🔥🔥✓ VerifiedFreeQuick setup
🧩 One of 7 skills in the prisma/cursor-plugin package — works on its own, and pairs well with its siblings.

Schema Changes. Reference when using this Prisma feature.

Inspect the full instructions your agent will receiveExpand

This is the exact playbook injected into your agent when the skill activates — shown here so you can audit it before installing. You don't need to read it to use the skill.

by prisma

Schema Changes. Reference when using this Prisma feature. npx skills add https://github.com/prisma/cursor-plugin --skill prisma-upgrade-v7-schema-changes Download ZIPGitHub8

Schema Changes

Prisma v7 introduces a new prisma-client generator. Update your generator block and import paths accordingly.

Generator Provider

Before (v6)

Copy & paste — that's it
generator client {
 provider = "prisma-client-js"
 engineType = "binary" // or "library"
}

After (v7)

Copy & paste — that's it
generator client {
 provider = "prisma-client"
 output = "../generated"
}

Key Changes

1. Provider name

Use prisma-client in Prisma v7.

2. Output is required (for prisma-client)

The output field is mandatory when using prisma-client. Prisma Client no longer generates to node_modules with this generator.

Copy & paste — that's it
generator client {
 provider = "prisma-client"
 output = "../generated" // Required for prisma-client
}

3. Engine type removed

engineType is removed in Prisma v7. Remove any engineType setting from your generator block.

Example Output Paths (prisma-client)

Standard project

Copy & paste — that's it
output = "../generated"

Creates: generated/client

Monorepo

Copy & paste — that's it
output = "../../packages/database/generated"

Same directory as schema

Copy & paste — that's it
output = "./generated"

Creates: prisma/generated/client

Datasource Block

The url, directUrl, and shadowDatabaseUrl values now live in prisma.config.ts in Prisma v7. Keep only the provider in schema.prisma:

Before (v6)

Copy & paste — that's it
datasource db {
 provider = "postgresql"
 url = env("DATABASE_URL")
 directUrl = env("DIRECT_URL")
}

After (v7)

Copy & paste — that's it
datasource db {
 provider = "postgresql"
 // URLs configured in prisma.config.ts
}
Copy & paste — that's it
// prisma.config.ts
export default defineConfig({
 datasource: {
 url: env('DATABASE_URL'),
 directUrl: env('DIRECT_URL'),
 shadowDatabaseUrl: env('SHADOW_DATABASE_URL'),
 },
})

Full Example

v6 Schema

Copy & paste — that's it
generator client {
 provider = "prisma-client-js"
 engineType = "library"
}

datasource db {
 provider = "postgresql"
 url = env("DATABASE_URL")
 directUrl = env("DIRECT_URL")
}

v7 Schema

Copy & paste — that's it
generator client {
 provider = "prisma-client"
 output = "../generated"
}

datasource db {
 provider = "postgresql"
}

After Schema Changes

Run prisma generate:

Copy & paste — that's it
npx prisma generate

Update imports throughout your codebase:

Copy & paste — that's it
// Before (prisma-client-js)
import { PrismaClient } from '@prisma/client'

// After (prisma-client, output = "../generated")
import { PrismaClient } from '../generated/client'

Update .gitignore (if using prisma-client output):

Copy & paste — that's it
generated

Preview Features

Preview features work the same:

Copy & paste — that's it
generator client {
 provider = "prisma-client"
 output = "../generated"
 previewFeatures = ["relationJoins", "fullTextSearch"]
}