/prisma-6:upgrading-to-prisma-6from prisma-6
Migrate from Prisma 5 to Prisma 6 handling breaking changes including Buffer to Uint8Array, implicit m-n PK changes, NotFoundError to P2025, and reserved keywords. Use when upgrading Prisma, encountering Prisma 6 type errors, or migrating legacy code.
Ships in prisma-6. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
This skill guides you through upgrading from Prisma 5 to Prisma 6, handling all breaking changes systematically to prevent runtime failures and type errors.
async, await, using are now reserved model/field namesAttempting to use Prisma 6 without these updates causes type errors, runtime failures, and migration issues.
## Migration WorkflowPhase 1: Pre-Migration Assessment
Identify all Bytes fields in schema
@db.ByteA, Bytes field typesFind implicit many-to-many relationships
@relation without relationNameLocate NotFoundError usage
NotFoundError imports and usageCheck for reserved keywords
async, await, usingPhase 2: Schema Migration
Update reserved keywords in schema
Generate migration for implicit m-n changes
npx prisma migrate dev --name v6-implicit-mn-pksPhase 3: Code Migration
Update Buffer → Uint8Array conversions
Buffer.from() with TextEncoder.toString() with TextDecoderUpdate NotFoundError handling
isPrismaClientKnownRequestError type guardTest all changes
Phase 4: Validation
Run TypeScript compiler
Run database migrations
Runtime testing
Breaking Changes Summary:
| Change | Before | After |
|---|---|---|
| Buffer API | Buffer.from(), .toString() | TextEncoder, TextDecoder |
| Error Handling | error instanceof NotFoundError | error.code === 'P2025' |
| Implicit m-n PK | Auto-increment id | Compound PK (A, B) |
| Reserved Words | async, await, using allowed | Must use @map() |
Migration Command:
npx prisma migrate dev --name v6-upgrade
Validation Commands:
npx tsc --noEmit
npx prisma migrate status
npm test
## Migration Guidelines
MUST:
SHOULD:
@map() when renaming reserved keywordsNEVER:
async, await, using as model/field names without @map()
After completing migration:
TypeScript Compilation:
npx tsc --noEmitDatabase Migration Status:
npx prisma migrate statusnpx prisma migrate deployRuntime Testing:
Performance Check:
Rollback Readiness:
For detailed migration guides and examples:
references/breaking-changes.md for complete API migration patterns, SQL examples, and edge casesreferences/migration-examples.md for real-world migration scenarios with before/after codereferences/migration-checklist.md for step-by-step migration tasksreferences/troubleshooting.md for common migration issues and solutionsFor framework-specific migration patterns:
For error handling patterns:
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub djankies/claude-configs --plugin prisma-619 skills in this plugin
/configuring-connection-poolsConfigure connection pool sizing for optimal performance. Use when configuring DATABASE_URL or deploying to production./configuring-serverless-clientsConfigure PrismaClient for serverless (Next.js, Lambda, Vercel) with connection_limit=1 and global singleton pattern./configuring-transaction-isolationConfigure transaction isolation levels to prevent race conditions and handle concurrent access. Use when dealing with concurrent updates, financial operations, inventory management, or when users mention race conditions, dirty reads, phantom reads, or concurrent modifications./creating-client-singletonsPrevent multiple PrismaClient instances that exhaust connection pools causing P1017 errors. Use when creating PrismaClient, exporting database clients, setting up Prisma in new files, or encountering connection pool errors. Critical for serverless environments./deploying-production-migrationsDeploy migrations to production safely using migrate deploy in CI/CD. Use when setting up production deployment pipelines./ensuring-query-type-safetyUse Prisma's generated types, `Prisma.validator`, and `GetPayload` for type-safe queries.