Bird
0
0

Which of the following is the correct syntax to create a new migration with Prisma CLI in a NestJS project?

easy📝 Syntax Q3 of 15
NestJS - Database with Prisma
Which of the following is the correct syntax to create a new migration with Prisma CLI in a NestJS project?
Anpx prisma migrate create --name addUserTable
Bnpx prisma migrate dev --name addUserTable
Cnpx prisma migrate save --name addUserTable
Dnpx prisma migrate generate --name addUserTable
Step-by-Step Solution
Solution:
  1. Step 1: Identify the command to create and apply migrations in dev

    The migrate dev command creates and applies a new migration with a name.
  2. Step 2: Check other options

    migrate create is not a valid Prisma CLI command, migrate save is deprecated, and migrate generate does not exist.
  3. Final Answer:

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

    Create migration in dev = migrate dev --name [OK]
Quick Trick: Use migrate dev with --name to create new migration [OK]
Common Mistakes:
  • Using migrate create which is invalid
  • Using deprecated migrate save
  • Confusing migrate generate with migrate dev

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More NestJS Quizzes