prisma-next-migrations

Generate, validate, and execute Prisma Next migration packages for Postgres and MongoDB.

47.5k|2.5k|Updated Jun 20, 2019
One-click install
npx skills add https://github.com/prisma/prisma --skill prisma-next-migrations
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: prisma-next-migrations
Source: https://github.com/prisma/prisma/tree/main/skills/prisma-next-migrations
Command: npx skills add https://github.com/prisma/prisma --skill prisma-next-migrations

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill solves the complexity of managing database schema changes and data transformations in a type-safe, version-controlled manner, preventing schema drift and migration failures.

Core Features & Use Cases

  • Migration Planning: Automatically generates migration packages by diffing your data contract against the database or migration graph.
  • Data Transformation: Provides a robust API for backfilling data during schema changes using check and run closures.
  • Error Recovery: Offers clear diagnostic paths for common issues like hash mismatches, unfilled placeholders, and database drift.

Quick Start

Use the prisma-next-migrations skill to plan a new migration named add-user-email and apply it to your database.

Frequently Asked Questions about prisma-next-migrations

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

FAQPage Schema
How do I manage database schema migrations and prevent schema drift in a TypeScript project?

Database schema migrations prevent schema drift by generating, validating, and executing version-controlled migration packages. This ensures database consistency by verifying the schema state against contract snapshots using automated diffing.

How do I backfill data during a database schema change in Prisma?

Data backfilling during a database schema change is handled using check and run closures within the migration package. This provides a robust API for transforming data transactionally while the schema evolves, preventing data loss.

Does Prisma Next migrations support both Postgres and MongoDB targets?

Yes, Prisma Next migrations support both Postgres and MongoDB targets. The migration runner automates diffing, applies content-addressed hashing, and executes schema changes transactionally across both database platforms.

How do I fix hash mismatches and unfilled placeholders when running database migrations?

Hash mismatches and unfilled placeholders during database migrations are resolved using built-in error recovery paths. The system provides clear diagnostics for these issues, along with detection for underlying database drift.

How do I plan and apply a new database migration from a data contract?

Planning a new database migration involves diffing your data contract against the existing database or migration graph to automatically generate a validated migration package. You then execute this package using the transactional migration runner to apply the schema changes safely.