PresentationInteractive, narrated presentation of the section content.
ContentDetailed description of the section content.
This time, we have no way of checking whether you have completed your solution or not so please try to complete this assessment and make sure you understand both processes:
Instructions
- Create an empty next.js project
npxcreate-next-app@latest prisma-play - Initialise Prisma
-
pnpm i prisma @prisma/client pnpm prisma init
-
- Change the provider to
sqliteand set theDATABASE_URLin your .env file tofile:./dev.db - Use the following Schema
model Post { id Int @id @default(autoincrement()) title String content String createdAt DateTime @default(now()) }- Run the migration
pnpm prisma migrate dev --name intial - Seed the database with some data
- Modify the schema as follows:
model Post { id Int @id @default(autoincrement()) title String content String createdAt DateTime @default(now()) tags String }- Run the migration
- Could you migrate? If not, can you fix the schema and migrate again!
- Re-seed the data with new structure
- Check out changes with
prisma studio - Roll back the migration
No hints available.
Discuss with OthersAsk questions, share your thoughts, and discuss with other learners.
Loading discussion ...