NOTE: Supabase has updated their setup instructions, which requires us to set up a shadow DB for migrations. Before continuing with this lesson, you’ll need to add the shadow DB as outlined in their instructions, then run prisma migrate reset.
In this lesson, we update our Prisma schema with a new model to store our lesson progress.
We add a LessonProgress model and link it to our Lesson object. This model only tracks if a specific user has completed a specific lesson or not.
We use the @@unique attribute to indicate that for each LessonProgress object, every pair of (user, lesson) is unique. This will be important in future lessons when we want to fetch and update these objects.
Prisma Attributes: https://www.prisma.io/docs/concepts/components/prisma-schema/data-model#defining-a-unique-field
18 lessons
7 lessons
7 lessons
11 lessons
18 lessons
8 lessons
17 lessons