Loading description ...
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
1. Create an empty next.js project npxcreate-next-app@latest prisma-play
2. Initialise Prisma
1. pnpm i prisma @prisma/client
2. pnpm prisma init
3. Change the provider to sqlite and set the DATABASE_URL in your .env file to
file:./dev.db
4. Use the following Schema
5. model Post {
id Int @id @default(autoincrement())
title String
content String
createdAt DateTime @default(now())
}
6. Run the migration pnpm prisma migrate dev --name intial
7. Seed the database with some data
8. Modify the schema as follows:
9. model Post {
id Int @id @default(autoincrement())
title String
content String
createdAt DateTime @default(now())
tags String
}
10. Run the migration
11. Could you migrate? If not, can you fix the schema and migrate again!
12. Re-seed the data with new structure
13. Check out changes with prisma studio
14. Roll back the migration
Maggie is a generative AI that can help you understand the course content better. You can ask her questions about the lecture, and she will try to answer them. You can also see the questions asked by other students and her responses.
Join the discussion to ask questions, share your thoughts, and discuss with other learners