prisma-migration-assistant

Plan and execute Prisma schema migrations with SQL preview and rollback strategies.

1|Updated Nov 6, 2025
One-click install
npx skills add https://github.com/zinohome/CozyChat --skill prisma-migration-assistant
Or copy as Structured Prompt for Agentโ–ผ
Please help me install this Agent Skill.
Skill: prisma-migration-assistant
Source: https://github.com/zinohome/CozyChat/tree/main/.claude/skills/prisma-migration-assistant
Command: npx skills add https://github.com/zinohome/CozyChat --skill prisma-migration-assistant

SYSTEM DOCUMENTATION & REQUIREMENTS

๐Ÿ’ก This Skill includes references (resource) and scripts (resource) components.

What problem does it solve?

This Skill streamlines the process of managing database schema changes with Prisma, ensuring migrations are safe, well-planned, and include strategies for data backfills and rollbacks.

Core Features & Use Cases

  • Migration Planning: Guides users through updating schema.prisma, generating SQL, and reviewing changes.
  • Data Transformation: Provides SQL examples for complex data migrations like splitting fields or changing types.
  • Backfill & Rollback: Offers strategies and code examples for handling data during and after migrations, including rollback procedures.
  • Use Case: Safely rename a database column in Prisma, ensuring existing data is copied and the new column is properly constrained, with a clear rollback plan.

Quick Start

Use the prisma-migration-assistant skill to plan a migration that renames the 'email' field to 'emailAddr' in the User model.

Frequently Asked Questions about prisma-migration-assistant

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

FAQPage Schema
How do I safely rename a database column in Prisma without losing existing data?โ–ผ

To safely rename a database column in Prisma, you should use an additive migration strategy that creates the new column, runs a SQL data backfill to copy existing values, and applies constraints before removing the old column.

What is the best way to handle data backfills during a Prisma schema migration?โ–ผ

Data backfills during a Prisma schema migration are handled by generating raw SQL scripts that transform and populate the new fields, ensuring data integrity before completing the schema change.

Can I preview the generated SQL for complex Prisma schema changes before applying them?โ–ผ

Yes, you can preview the generated SQL for complex Prisma schema changes to review the exact database commands for data transformations, type changes, and column renames prior to execution.

How do I create a rollback strategy for a Prisma migration?โ–ผ

Creating a rollback strategy for a Prisma migration involves defining inverse SQL scripts and step-by-step procedures to revert schema changes and restore data to its previous state if the deployment fails.

Does Prisma support complex data transformations like splitting fields or changing types in migrations?โ–ผ

Prisma supports complex data transformations like splitting fields or changing types by generating custom SQL scripts that execute the necessary data conversions alongside the standard schema updates.

When should I use an additive migration approach for database schema changes?โ–ผ

You should use an additive migration approach for database schema changes when you need to maintain zero downtime, allowing you to deploy backward-compatible schema updates before removing deprecated fields.