v0 database

Prisma Migration Conflict After Schema Changes

After modifying your Prisma schema, migrations fail with 'Migration conflict' or 'Schema divergence detected' errors. Your database schema doesn't match the generated migrations.

This typically occurs when multiple developers create conflicting migrations or the local migration history doesn't match the database state.

Error Messages You Might See

[migrate] Conflict detected [migrate] Schema divergence detected The migration `xxxxxxxx_migration_name` already exists Database schema doesn't match your Prisma schema
[migrate] Conflict detected[migrate] Schema divergence detectedThe migration `xxxxxxxx_migration_name` already existsDatabase schema doesn't match your Prisma schema

Common Causes

  1. Two developers created different migrations with the same timestamp or conflicting changes
  2. Local migration files were deleted but database state remains
  3. Database already has the schema changes but Prisma migrations don't reflect this
  4. Merging branches with different migration histories
  5. Manual database changes made outside of Prisma migrations

How to Fix It

Resolve merge conflicts: If merging branches, check git history of migrations/ folder for conflicts. Resolve manually and recreate new migration.

Reset in development: For dev only: npx prisma migrate reset clears database and replays migrations from scratch.

Recovery in production: Use npx prisma migrate resolve --rolled-back migration_name to mark failed migration as rolled back, then create a new one.

Prevent conflicts: Use npx prisma migrate dev --name descriptive_name to create new migrations, commit them before pushing.

Real developers can help you.

legrab legrab I'll fill this later Jen Jacobsen Jen Jacobsen I’m a Full-Stack Developer with over 10 years of experience building modern web and mobile applications. I enjoy working across the full product lifecycle — turning ideas into real, well-built products that are intuitive for users and scalable for businesses. I particularly enjoy building mobile apps, modern web platforms, and solving complex technical problems in a way that keeps systems clean, reliable, and easy to maintain. Daniel Vázquez Daniel Vázquez Software Engineer with over 10 years of experience on Startups, Government, big tech industry & consulting. Stanislav Prigodich Stanislav Prigodich 15+ years building iOS and web apps at startups and enterprise companies. I want to use that experience to help builders ship real products - when something breaks, I'm here to fix it. Anthony Akpan Anthony Akpan Developer with 8 years of experience building softwares fro startups Matt Butler Matt Butler Software Engineer @ AWS BurnHavoc BurnHavoc Been around fixing other peoples code for 20 years. Sage Fulcher Sage Fulcher Hey I'm Sage! Im a Boston area software engineer who grew up in South Florida. Ive worked at a ton of cool places like a telehealth kidney care startup that took part in a billion dollar merger (Cricket health/Interwell health), a boutique design agency where I got to work on a ton of exciting startups including a photography education app, a collegiate Esports league and more (Philosophie), a data analytics as a service startup in Cambridge (MA) as well as at Phillips and MIT Lincoln Lab where I designed and developed novel network security visualizations and analytics. I've been writing code and furiously devoted to using computers to make people’s lives easier for about 17 years. My degree is in making computers make pretty lights and sounds. Outside of work I love hip hop, the Celtics, professional wrestling, magic the gathering, photography, drumming, and guitars (both making and playing them) Rudra Bhikadiya Rudra Bhikadiya I build and fix web apps across Next.js, Node.js, and DBs. Comfortable jumping into messy code, broken APIs, and mysterious bugs. If your project works in theory but not in reality, I help close that gap. Victor Denisov Victor Denisov Developer

You don't need to be technical. Just describe what's wrong and a verified developer will handle the rest.

Get Help

Frequently Asked Questions

Can I delete migration files if I haven't deployed?

Only if your local database matches your schema. Reset with 'prisma migrate reset' first, then delete conflicts.

How do I handle migration conflicts in team development?

Establish a process: create descriptive migration names, merge feature branches before creating new migrations.

What's the difference between migrate dev and migrate deploy?

'migrate dev' is interactive, creates new migrations. 'migrate deploy' applies existing migrations to prod without prompts.

Related v0 Issues

Can't fix it yourself?
Real developers can help.

You don't need to be technical. Just describe what's wrong and a verified developer will handle the rest.

Get Help