Bird
0
0

You run npx prisma migrate deploy in production but get an error saying migrations are missing. What is the likely cause?

medium📝 Debug Q14 of 15
NestJS - Database with Prisma
You run npx prisma migrate deploy in production but get an error saying migrations are missing. What is the likely cause?
AYou forgot to create migration files locally before deploying
BThe database connection string is incorrect
CYou ran migrate dev instead of migrate deploy
DPrisma client was not generated
Step-by-Step Solution
Solution:
  1. Step 1: Understand migrate deploy requirements

    migrate deploy applies existing migration files to production; it does not create them.
  2. Step 2: Identify cause of missing migrations error

    If migration files were not created locally (e.g., with migrate dev), deploy will fail due to missing files.
  3. Final Answer:

    You forgot to create migration files locally before deploying -> Option A
  4. Quick Check:

    Deploy needs existing migrations [OK]
Quick Trick: Create migrations locally before deploying to production [OK]
Common Mistakes:
  • Confusing migrate dev and migrate deploy roles
  • Ignoring missing migration files
  • Assuming wrong DB connection causes missing migrations error

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More NestJS Quizzes