Skip to content
Prisma 7 Upgrade Guide

Prisma 7 Upgrade Guide Skill

Prisma's official skill for migrating an ORM project from v6 to v7 - the prisma-client generator, driver adapters, prisma.config.ts, ESM entrypoints and every removed API.

GitHub Docs
Development
Added to Onei
v7.6.0
MIT

Install

Install with the skills CLI

One command for Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf and dozens of other agents. Needs Node.js; the skill is fetched straight from prisma/skills.

$ npx skills add prisma/skills --skill prisma-upgrade-v7

Run it in a terminal. The CLI finds the agents installed on your machine, asks which ones to add the skill to, and whether to install it into the folder you ran it from or for all your projects.

Other ways to install

  1. Open the skill on GitHub and download the folder that holds its SKILL.md.
  2. Put it at ~/.claude/skills/prisma-upgrade-v7/, where Claude Code picks it up in every project.

No scripts or references next to it? Saving the SKILL.md alone as ~/.claude/skills/prisma-upgrade-v7/SKILL.md works too.

Using another agent? Its personal skills folder
Codex
~/.agents/skills/
Cursor
~/.cursor/skills/
GitHub Copilot
~/.copilot/skills/
Gemini CLI
~/.gemini/skills/
Windsurf
~/.codeium/windsurf/skills/
OpenCode
~/.config/opencode/skills/

About

  • Eight-step ordered migration from Prisma v6 to v7
  • Breaking changes grouped by priority with citable rule prefixes
  • Driver adapter setup for SQL providers
  • prisma.config.ts and ESM-first configuration
  • Prisma.validator to satisfies conversion
  • Troubleshooting for post-upgrade module, SSL and timeout errors
  • Explicit MongoDB dead-end detection

Prisma ORM 7 is a breaking release, and this is Prisma's own skill for getting an existing v6 codebase across the gap without a day of guesswork. It gives an agent an ordered migration procedure plus the failure modes to watch for, so the upgrade is executed rather than improvised.

What it covers

The skill walks the migration in eight steps: updating package.json for ESM-first projects, adjusting tsconfig.json, moving schema.prisma to the new prisma-client generator, creating a prisma.config.ts, installing a driver adapter (required now for SQL providers), updating client instantiation, replacing Prisma.validator with TypeScript's satisfies, and finally running migrations and regenerating the client.

Breaking changes are grouped by priority so the agent tackles blockers first, and each rule carries a prefix so it can be cited. Removed features are listed explicitly - middleware, metrics and several CLI flags - along with the new generated client entrypoints (client, browser, models, enums) and the fact that environment variables must now be loaded manually.

Guardrails

Two things make this more useful than a changelog. First, it has a troubleshooting section for the errors that actually show up after an upgrade: "cannot find module" from the new entrypoints, SSL certificate failures, and connection timeouts introduced by driver adapters. Second, it refuses to lead a MongoDB project down a dead end - MongoDB has no Prisma 7 connector, so the skill hands off to a separate decision guide rather than producing an impossible plan. Accelerate users get their own handling.

Use it when

Upgrading to Prisma 7, switching to the prisma-client generator, setting up driver adapters, configuring prisma.config.ts, or debugging import errors that appeared after a version bump.

Part of the prisma/skills collection, which follows the Agent Skills open standard and installs with npx skills add prisma/skills. MIT licensed.

Try it

Once installed, ask your agent something like:

Upgrade this project from Prisma 6 to Prisma 7.

SKILL.md

The instructions your agent loads, as published by Prisma.

SKILL.md
name
prisma-upgrade-v7
description
Complete migration guide from Prisma ORM v6 to v7 covering all breaking changes. Use when upgrading Prisma versions, encountering v7 errors, or migrating existing projects. Triggers on "upgrade to prisma 7", "prisma 7 migration", "prisma-client generator", "driver adapter required".
license
MIT
metadata
author: prisma version: "7.6.0"

Upgrade to Prisma ORM 7

Complete guide for migrating from Prisma ORM v6 to v7. This upgrade introduces significant breaking changes around the new prisma-client generator, driver adapters, prisma.config.ts, explicit environment loading, and generated client entrypoints.

When to Apply

Reference this skill when:

  • Upgrading from Prisma v6 to v7
  • Updating to the prisma-client generator
  • Setting up driver adapters
  • Configuring prisma.config.ts
  • Fixing import errors after upgrade
Rule Categories by Priority
PriorityCategoryImpactPrefix
1Schema MigrationCRITICALschema-changes
2Database ConnectivityCRITICALdriver-adapters
3Module SystemCRITICALesm-support
4Config and EnvHIGHprisma-config, env-variables
5Removed FeaturesHIGHremoved-features
6AccelerateHIGHaccelerate-users
Quick Reference
  • schema-changes - generator migration, required output paths, generated entrypoints, and Prisma.validator replacement
  • driver-adapters - required adapter installation for SQL providers, pool differences, and Prisma Postgres adapter choices
  • esm-support - ESM-first setup plus CommonJS fallback with moduleFormat = "cjs"
  • prisma-config - creating and using prisma.config.ts
  • env-variables - explicit environment loading
  • removed-features - removed middleware, metrics, and legacy CLI behavior
  • accelerate-users - migration notes for Accelerate users
Using MongoDB? This guide does not apply

Prisma 7 has no MongoDB connector. Do not apply any step in this guide to a project with
provider = "mongodb" — see the prisma-mongodb-upgrade skill for the actual decision
(stay on v6 deliberately vs migrate to Prisma Next).

Important Notes
  • MongoDB projects should stay on Prisma 6.x or migrate to Prisma Next - do not migrate MongoDB apps to Prisma 7's SQL client path (see prisma-mongodb-upgrade)
  • Node.js 20.19.0+ required
  • TypeScript 5.4.0+ required
  • Latest stable Prisma ORM version: 7.6.0
Upgrade Steps Overview
  1. Update packages to v7
  2. Choose your module format (esm by default, cjs if needed)
  3. Update TypeScript configuration
  4. Update the schema generator block
  5. Create prisma.config.ts
  6. Install and configure a driver adapter for SQL providers
  7. Update Prisma Client imports
  8. Update client instantiation
  9. Replace deprecated helper patterns like Prisma.validator
  10. Run prisma generate and test
Quick Upgrade Commands
# Update packages
npm install @prisma/client@7
npm install -D prisma@7

# Install a driver adapter (PostgreSQL or Prisma Postgres via direct TCP)
npm install @prisma/adapter-pg pg

# Install dotenv for env loading
npm install dotenv

# Regenerate client
npx prisma generate
Breaking Changes Summary
Changev6v7
Module formatImplicit / mixedESM-first, moduleFormat = "cjs" supported
Generator providerprisma-client-jsprisma-client is the default, while prisma-client-js still exists for legacy setups
Output pathAuto (node_modules)Required explicit
Driver adaptersOptionalRequired for SQL providers
Config file.env + schemaprisma.config.ts
Env loadingAutomaticManual (dotenv)
Generated entrypointsSingle package exportclient, browser, models, enums entrypoints
Type-safe query fragmentsPrisma.validator()TypeScript satisfies
Middleware$use()Client Extensions
MetricsPreview featureRemoved
Rule Files

Detailed migration guides for each breaking change:

references/esm-support.md        - ESM and CommonJS configuration
references/schema-changes.md     - Generator, output, imports, and generated entrypoints
references/driver-adapters.md    - Required driver adapter setup
references/prisma-config.md      - New configuration file
references/env-variables.md      - Environment variable loading
references/removed-features.md   - Middleware, metrics, and CLI flags
references/accelerate-users.md   - Special handling for Accelerate
Step-by-Step Migration
1. Update package.json for ESM-first projects
{
  "type": "module"
}

If you need to stay on CommonJS, keep your app as CJS and set moduleFormat = "cjs" in the generator block instead of forcing ESM.

2. Update tsconfig.json
{
  "compilerOptions": {
    "module": "ESNext",
    "moduleResolution": "bundler",
    "target": "ES2023",
    "strict": true,
    "esModuleInterop": true
  }
}
3. Update schema.prisma
// Before (v6)
generator client {
  provider = "prisma-client-js"
}

// After (v7)
generator client {
  provider = "prisma-client"
  output   = "../generated/prisma"
  // Optional if you need CommonJS:
  // moduleFormat = "cjs"
}
4. Create prisma.config.ts
import 'dotenv/config'
import { defineConfig, env } from 'prisma/config'

export default defineConfig({
  schema: 'prisma/schema.prisma',
  migrations: {
    path: 'prisma/migrations',
  },
  datasource: {
    url: env('DATABASE_URL'),
  },
})
5. Install a driver adapter (SQL providers only)
# PostgreSQL
npm install @prisma/adapter-pg pg

# MySQL
npm install @prisma/adapter-mariadb mariadb

# SQLite
npm install @prisma/adapter-better-sqlite3 better-sqlite3

# Prisma Postgres in standard Node.js apps (recommended)
npm install @prisma/adapter-pg pg

# Prisma Postgres serverless driver (edge/serverless)
npm install @prisma/adapter-ppg @prisma/ppg

# Neon
npm install @prisma/adapter-neon

MongoDB does not have a SQL @prisma/adapter-* package in the published Prisma 7.6.0 packages. If you're upgrading a MongoDB project, stop and keep that project on the latest Prisma 6.x release instead of following the standard Prisma 7 migration path.

6. Update client instantiation
// Before (v6)
import { PrismaClient } from '@prisma/client'
const prisma = new PrismaClient()

// After (v7)
import { PrismaClient } from '../generated/prisma/client'
import { PrismaPg } from '@prisma/adapter-pg'

const adapter = new PrismaPg({
  connectionString: process.env.DATABASE_URL
})

const prisma = new PrismaClient({ adapter })
7. Replace Prisma.validator with satisfies
import { Prisma } from '../generated/prisma/client'

const userSelect = {
  id: true,
  email: true,
  name: true,
} satisfies Prisma.UserSelect
8. Run migrations and generate
npx prisma generate
npx prisma migrate dev  # if needed
Troubleshooting
"Cannot find module" errors
  • Check that the generator output path matches your import path
  • Ensure prisma generate ran successfully
SSL certificate errors
  • Add ssl: { rejectUnauthorized: false } to the adapter config if you need to preserve old behavior
  • Or configure your certificates properly with NODE_EXTRA_CA_CERTS / OpenSSL CA settings
Connection timeout issues
  • Driver adapters use the underlying driver's defaults, which differ from v6
  • Configure pool settings explicitly on the adapter if needed
Resources
How to Use

Follow references/schema-changes.md and references/driver-adapters.md first, then apply the remaining reference files based on your project setup.

Install

Convex's official skill for changing the schema of a deployed app without breaking it — add the field optional, backfill with @convex-dev/migrations, verify, then tighten the validator.

A controlled upgrade path from Inngest SDK v3 to v4 — triggers into createFunction options, EventSchemas to eventType, realtime imports, step.invoke string IDs — with a scan-first, verify-last order.

Skill: Convex

by Convex

Featured

Convex's official top-level agent skill — routes an agent to the right convex-* skill for the task and to a served capability catalogue that stays current without a reinstall.

Browse all skills →