ba-db-prisma-migrate

Generate timestamped Prisma migrations from schema gap analysis.

Updated Apr 12, 2026
One-click install
npx skills add https://github.com/Yukine5377/common --skill ba-db-prisma-migrate
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ba-db-prisma-migrate
Source: https://github.com/Yukine5377/common/tree/main/.cursor/skills/ba-db-prisma-migrate
Command: npx skills add https://github.com/Yukine5377/common --skill ba-db-prisma-migrate

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Updates Prisma schema and migrations versioned from User Story/ERD; provides guidance to run migrate dev/deploy, generate, and seed. Reminds postinstall generate, tsconfig include prisma, and IDE monorepo to avoid PrismaClient errors.

Core Features & Use Cases

  • Gap analysis: derive necessary changes from user stories or ERD to the Prisma data model.
  • Migration creation: generate timestamped migration folders under prisma/migrations and maintain a clean history without overwriting existing migrations.
  • Guidance: orchestrates or suggests commands for migrate dev/deploy, generate, and seed, ensuring postinstall and tsconfig/prisma config are aligned.
  • Warning: flags potentially destructive changes (DROP/rename with data) and requires user confirmation before risky operations.

Quick Start

Automatically align your Prisma schema with your data model by generating a versioned migration.

Frequently Asked Questions about ba-db-prisma-migrate

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

FAQPage Schema
How do I generate versioned Prisma migrations from an ERD or user story?

To generate versioned Prisma migrations, the skill performs gap analysis on your user story or ERD against your existing schema.prisma. It then produces timestamped migration folders under prisma/migrations to keep your database history consistent without overwriting previous files.

What is the best way to sync Prisma schema changes without losing existing migration history?

Syncing Prisma schema changes safely requires deriving necessary updates from your ERD and applying them as new timestamped migration folders. This approach maintains a clean, versioned history under prisma/migrations without overwriting your existing migration files.

Do I need a valid schema.prisma file before automating database migration generation?

Yes, a valid schema.prisma file is a strict prerequisite for automating database migration generation. The tool requires this file to enforce project-context rules and accurately perform gap analysis to generate the necessary migrate dev or deploy commands.

How do I handle destructive schema changes like dropping tables during Prisma migration?

Handling destructive schema changes during Prisma migration involves flagging operations like DROP or rename that risk data loss. The system automatically detects these risky operations and requires explicit user confirmation before proceeding with the migration.

Why does PrismaClient throw errors after running prisma migrate dev in a monorepo?

PrismaClient errors after running prisma migrate dev often occur when tsconfig include prisma paths or IDE monorepo settings are misconfigured. The tool provides guidance to align postinstall generate commands and configuration to prevent these issues.