prisma-migration-drift-recovery

Baseline existing databases to Prisma migrations without data loss.

9|2|Updated Mar 5, 2026
One-click install
npx skills add https://github.com/DavidTeju/shared-skills --skill prisma-migration-drift-recovery
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: prisma-migration-drift-recovery
Source: https://github.com/DavidTeju/shared-skills/tree/main/skills/prisma-migration-drift-recovery
Command: npx skills add https://github.com/DavidTeju/shared-skills --skill prisma-migration-drift-recovery

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Baseline drift in Prisma migrations on existing databases can cause schema and migration history to diverge, risking data loss if mishandled.

Core Features & Use Cases

  • Baseline existing databases to Prisma migrations without data loss.
  • Safely apply incremental changes using prisma migrate diff and prisma migrate resolve.
  • Use cases include adopting Prisma on Supabase/direct SQL projects or migrations that diverged from Prisma's history.

Quick Start

Baseline the existing database and re-sync Prisma schema with the database in a safe, data-preserving workflow.

Frequently Asked Questions about prisma-migration-drift-recovery

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

FAQPage Schema
How do I baseline an existing database to Prisma migrations without data loss?

Prisma migration drift occurs when your database schema and migration history diverge, often after changes made via direct SQL, Supabase, or another ORM. Correcting this drift safely prevents potential data loss during future migrations.

What is the best way to fix Prisma migration drift on a Supabase database?

To baseline an existing database to Prisma migrations without data loss, you use SQL-based baselining and migration history alignment. This workflow safely re-syncs your schema.prisma file with the current database state.

Can I adopt Prisma migrations on a database created with direct SQL or another ORM?

Yes, you can adopt Prisma migrations on databases created with direct SQL or another ORM by establishing a baseline. This process aligns Prisma's migration history with your existing schema to enable safe incremental changes.

When do I need to use prisma migrate resolve and prisma migrate diff?

You need to use prisma migrate resolve and prisma migrate diff when correcting schema drift and baselining existing databases. They help re-sync schema.prisma with the database and apply incremental changes safely.

Why does Prisma migration history diverge from my database schema?

Prisma migration history diverges from your database schema when structural changes are made outside Prisma, such as through direct SQL, Supabase, or another ORM. This drift requires baselining to safely re-sync.