upgrading-to-prisma-6

Guide Prisma 5-to-6 migrations addressing breaking changes and validation.

Updated Nov 21, 2025
One-click install
npx skills add https://github.com/djankies/claude-configs --skill upgrading-to-prisma-6
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: upgrading-to-prisma-6
Source: https://github.com/djankies/claude-configs/tree/main/prisma-6/skills/upgrading-to-prisma-6
Command: npx skills add https://github.com/djankies/claude-configs --skill upgrading-to-prisma-6

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Prisma 6 introduces four breaking changes that require code updates and careful migration. This Skill guides you through upgrading from Prisma 5 to Prisma 6, addressing Buffer → Uint8Array, implicit m-n primary keys, NotFoundError removal, and reserved keywords to prevent runtime errors and type issues.

Core Features & Use Cases

  • Migration phases: Pre-Migration Assessment, Schema Migration, Code Migration, and Validation to structure the upgrade.
  • Code updates: Guidance on updating Buffer → Uint8Array conversions, NotFoundError handling, and reserved keywords.
  • Validation: TypeScript checks and migration review before production upgrade.

Quick Start

Run the Prisma 6 upgrade workflow in your project. Start with a pre-migration assessment to locate Bytes fields, implicit m-n relations, NotFoundError usage, and reserved keywords; then apply schema and code changes; finally validate with TS compilation and a test migration.

Frequently Asked Questions about upgrading-to-prisma-6

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What are the main breaking changes in Prisma 6 I need to address?

Prisma 6 introduces four breaking changes: Buffer fields convert to Uint8Array, implicit many-to-many primary keys change, NotFoundError is removed (replaced by P2025), and reserved keywords must be renamed. Each requires schema and application code updates to prevent runtime errors and type mismatches.

How do I migrate from Prisma 5 to Prisma 6?

Follow four phases: pre-migration assessment to locate Bytes fields, implicit m-n relations, NotFoundError usage, and reserved keywords; schema migration applying @map to reserved names; code migration updating Buffer to Uint8Array and error handling; validation via TypeScript compilation and test migration.

How do I update error handling from NotFoundError to Prisma 6?

Replace NotFoundError catch blocks with P2025 error code checks. Prisma 6 removes the NotFoundError exception; instead, inspect the thrown error's code property for P2025 to identify not-found scenarios in your application code.

What schema changes do reserved keywords require in Prisma 6?

Rename fields and models that conflict with Prisma reserved keywords using the @map directive to preserve database column names. This prevents compilation failures and allows your schema to remain compatible with your existing database structure.

Do I need to regenerate Prisma migrations when upgrading to version 6?

Yes. Generate and validate new migrations after schema changes to ensure implicit m-n relation primary key updates and any structural modifications are captured. Test the migration in a non-production environment before applying to production.

How do I convert Buffer fields to Uint8Array in Prisma 6?

Update Bytes field type annotations and runtime handling from Buffer to Uint8Array. This aligns with Prisma 6's stricter type requirements and ensures compatibility with modern JavaScript environments.