safe-migration

Execute Prisma database migrations with enforced safeguards and user confirmation.

1|Updated Apr 28, 2025
One-click install
npx skills add https://github.com/myoshi2891/Multi-Vendor-E-Commerce --skill safe-migration
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: safe-migration
Source: https://github.com/myoshi2891/Multi-Vendor-E-Commerce/tree/main/.claude/skills/safe-migration
Command: npx skills add https://github.com/myoshi2891/Multi-Vendor-E-Commerce --skill safe-migration

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill ensures that Prisma database migrations are performed safely and systematically, preventing accidental data loss or corruption by enforcing best practices and user confirmation.

Core Features & Use Cases

  • Enforced migrate dev: Strictly prohibits db push and mandates migrate dev for all schema changes.
  • Mandatory Backups & Confirmation: Requires explicit user confirmation after verifying database backups.
  • Destructive Operation Warnings: Identifies and warns about potentially destructive SQL operations (DROP, DELETE, ALTER DROP) before execution.
  • Spec Compliance Check: Validates schema changes against project specifications (specs/multi-vendor-ecommerce/03-data-model.md).
  • Code & Spec Update Suggestions: Recommends necessary updates to server actions, types, schemas, and documentation.
  • Use Case: When you need to add a new field to your Product model, this Skill will guide you through creating a safe migration, ensuring your database remains consistent and your codebase is updated accordingly.

Quick Start

Use the safe-migration skill to execute a Prisma migration for adding a new field to the product model.

Frequently Asked Questions about safe-migration

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

FAQPage Schema
How do I safely execute Prisma migrations without losing data?

Safe Prisma migrations require enforcing `migrate dev` over `db push`, verifying database backups with explicit user confirmation, and identifying potentially destructive SQL operations before execution to prevent data loss.

Why should I use migrate dev instead of db push for schema changes?

Using `migrate dev` instead of `db push` ensures schema changes generate trackable migration history. It enforces systematic updates and validates changes against specifications, preventing accidental data corruption that `db push` might cause.

How do I check Prisma schema changes against project specifications?

Validate Prisma schema changes against project specifications by checking modifications against defined documentation like `specs/multi-vendor-ecommerce/03-data-model.md` to ensure structural consistency and compliance before applying migrations.

Does Prisma warn about destructive SQL operations like DROP or DELETE?

Prisma migration processes can identify and warn about potentially destructive SQL operations such as DROP, DELETE, and ALTER DROP before execution, requiring explicit user confirmation to prevent accidental data loss.

What code updates are needed after a Prisma database migration?

After a Prisma database migration, update server actions, types, schemas, and documentation. The migration process suggests necessary code modifications to keep the codebase consistent with the new database schema.

Can I use db push for quick schema updates in Prisma?

Using `db push` for schema updates is prohibited in safe migration workflows. You must use `migrate dev` to ensure all schema changes are tracked, validated against specifications, and applied systematically.