Bird
0
0

Which command correctly creates a new migration during development with Prisma in NestJS?

easy📝 Syntax Q12 of 15
NestJS - Database with Prisma
Which command correctly creates a new migration during development with Prisma in NestJS?
Anpx prisma migrate dev --name addUserTable
Bnpx prisma migrate deploy --name addUserTable
Cnpx prisma generate --name addUserTable
Dnpx prisma migrate reset --name addUserTable
Step-by-Step Solution
Solution:
  1. Step 1: Identify the correct command for creating migrations

    The command npx prisma migrate dev --name is used to create and apply migrations during development.
  2. Step 2: Eliminate incorrect commands

    migrate deploy applies migrations in production, generate creates Prisma client code, and migrate reset resets the database.
  3. Final Answer:

    npx prisma migrate dev --name addUserTable -> Option A
  4. Quick Check:

    Dev migrations use migrate dev [OK]
Quick Trick: Use migrate dev to create migrations in development [OK]
Common Mistakes:
  • Using migrate deploy instead of migrate dev for new migrations
  • Confusing generate with migration commands
  • Trying to reset DB when creating migrations

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More NestJS Quizzes