0
0
NestJSframework~10 mins

Prisma migrations in NestJS - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to run a Prisma migration command in the terminal.

NestJS
npx prisma migrate [1] --name init
Drag options to blanks, or click blank then click option'
Adeploy
Bdev
Cgenerate
Dreset
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'deploy' instead of 'dev' which is for production deployment.
Using 'reset' which deletes data and resets the database.
Using 'generate' which only generates Prisma client code.
2fill in blank
medium

Complete the code to generate Prisma client after migration.

NestJS
npx prisma [1]
Drag options to blanks, or click blank then click option'
Agenerate
Bstudio
Cmigrate
Dclient
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'migrate generate' which is not a valid command.
Using 'studio generate' which opens Prisma Studio instead.
Using 'client generate' which is not a Prisma CLI command.
3fill in blank
hard

Fix the error in the migration command to reset the database.

NestJS
npx prisma migrate [1]
Drag options to blanks, or click blank then click option'
Apush
Bapply
Csave
Dreset
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'apply' which is not a Prisma migrate command.
Using 'save' which does not exist in Prisma CLI.
Using 'push' which pushes schema changes without migrations.
4fill in blank
hard

Fill both blanks to create a migration and apply it in one command.

NestJS
npx prisma migrate [1] --name [2]
Drag options to blanks, or click blank then click option'
Adev
Bdeploy
Cinit
Dreset
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'deploy' which is for production migration.
Using 'reset' which clears the database.
Using 'dev' with an invalid migration name.
5fill in blank
hard

Fill all three blanks to push schema changes without migration files.

NestJS
npx prisma [1] [2] --accept-data-loss [3]
Drag options to blanks, or click blank then click option'
Amigrate
Bdb
Cpush
D--skip-generate
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'migrate' instead of 'db' for pushing schema.
Omitting the '--accept-data-loss' flag which is required to push changes forcibly.
Not skipping client generation when not needed.