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.

Dor Yaloz Dor Yaloz SW engineer with 6+ years of experience, I worked with React/Node/Python did projects with React+Capacitor.js for ios Supabase expert ISHANTDEEP SINGH ISHANTDEEP SINGH Senior Software Engineer with 7+ years of experience in React, JavaScript, TypeScript, Next.js, and Node.js. I’ve also worked as a tech lead for startups, owning end-to-end technical execution including architecture, development, scaling, and delivery. I bring a strong mix of hands-on coding, product thinking, and technical leadership, and I’m comfortable building products from scratch as well as improving and scaling existing systems. Jared Hasson Jared Hasson Full time lead founding dev at a cyber security saas startup, with 10 yoe and a bachelor's in CS. Building & debugging software products is what I've spent my time on for forever Basel Issmail Basel Issmail ’m a Senior Full-Stack Developer and Tech Lead with experience designing and building scalable web platforms. I work across the full development lifecycle, from translating business requirements into technical architecture to delivering reliable production systems. My work focuses on modern web technologies, including TypeScript, Angular, Node.js, and cloud-based architectures. I enjoy solving complex technical problems and helping teams turn product ideas and prototypes into working platforms that can grow and scale. In addition to development, I often collaborate closely with product managers, business analysts, designers, and QA teams to ensure that solutions align with both technical and business goals. I enjoy working with startups and product teams where I can contribute both as a hands-on engineer and as a technical partner in designing and delivering impactful software. Krishna Sai Kuncha Krishna Sai Kuncha Experienced Professional Full stack Developer with 8+ years of experience across react, python, js, ts, golang and react-native. Developed inhouse websearch tooling for AI before websearch was solved : ) Luca Liberati Luca Liberati I work on monoliths and microservices, backends and frontends, manage K8s clusters and love to design apps architecture Meïr Ankri Meïr Ankri Full-stack developer specializing in React / Next.js / Node.js with 6+ years of experience. I've worked across various sectors including automotive (Reezocar/Société Générale), healthcare (Medical Link SaaS), and e-commerce (Glasman). I build web apps end-to-end, from architecture to production, with a focus on scalability, performance, and code quality. I also mentor junior developers and contribute to technical decisions and code reviews. Costea Adrian Costea Adrian Embedded Engineer specilizing in perception systems. Latest project was a adas camera calibration system. Prakash Prajapati Prakash Prajapati I’m a Senior Python Developer specializing in building secure, scalable, and highly available systems. I work primarily with Python, Django, FastAPI, Docker, PostgreSQL, and modern AI tooling such as PydanticAI, focusing on clean architecture, strong design principles, and reliable DevOps practices. I enjoy solving complex engineering problems and designing systems that are maintainable, resilient, and built to scale. Richard McSorley Richard McSorley Full-Stack Software Engineer with 8+ years building high-performance applications for enterprise clients. Shipped production systems at Walmart (4,000+ stores), Cigna (20M+ users), and Arkansas Blue Cross. 5 patents in retail/supply chain tech. Currently focused on AI integrations, automation tools, and TypeScript-first architectures.

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