prisma-migrations

Create, deploy, and validate Prisma migrations with schema.prisma alignment.

4|11|Updated May 1, 2025
One-click install
npx skills add https://github.com/Rational-Partners/ai-training-practical --skill prisma-migrations-rational-partners
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: prisma-migrations
Source: https://github.com/Rational-Partners/ai-training-practical/tree/main/.claude/skills/prisma-migrations
Command: npx skills add https://github.com/Rational-Partners/ai-training-practical --skill prisma-migrations-rational-partners

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Prisma migrations are error-prone; forgetting to create or deploy migrations can cause production crashes. This Skill provides a disciplined workflow to manage Prisma migrations safely and consistently.

Core Features & Use Cases

  • Safe migration creation, validation, deployment, and client regeneration using Prisma.
  • Guardrails to prevent forgetting migrations and to keep schema.prisma aligned with database state.
  • Use cases include adding fields, renaming models, or evolving the schema in production with minimal risk.

Quick Start

Follow the safe Prisma migration workflow to create, apply, and verify a migration.

Frequently Asked Questions about prisma-migrations

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

FAQPage Schema
How do I prevent production crashes from forgotten Prisma migrations?

To prevent production crashes from forgotten Prisma migrations, you need a workflow that enforces creating, deploying, and validating changes to schema.prisma. This ensures migrations are never skipped and the database state remains consistently aligned.

What is the safest way to deploy a Prisma schema migration to production?

The safest way to deploy a Prisma schema migration is to follow a strict sequence: read the reference, update schema.prisma, generate the migration, verify migration.sql exists, and regenerate the Prisma client to ensure validation and prevent data loss.

Why does my Prisma client crash after updating schema.prisma?

Your Prisma client crashes after updating schema.prisma because the migration was likely not created or deployed, causing a mismatch between the client and database. Regenerating the client and validating migration.sql ensures alignment and prevents errors.

Do I need to regenerate the Prisma client after creating a migration?

Yes, you need to regenerate the Prisma client after creating a migration. Client regeneration is a required step in the safe migration workflow to ensure your application code matches the newly deployed database schema and avoid runtime query errors.

How do I add fields to a Prisma model without losing production data?

To add fields to a Prisma model without losing production data, update schema.prisma and generate a migration using a safe migration workflow. This process validates the migration.sql file and applies schema changes with minimal risk to existing data.

What are the limitations of managing Prisma migrations manually?

Managing Prisma migrations manually is error-prone because forgetting to create or deploy migrations can cause production crashes. Without guardrails to ensure migration.sql exists and the client is regenerated, schema changes risk data loss and deployment failures.