Join our community

Get access to the complete guide to developing and deploying fast, production-ready Nuxt apps.

6-3 Add LessonProgress Model to Our Schema

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

This course was originally built with Nuxt 3, but it's no longer being maintained. You can still follow the lessons, but make sure to use the exact dependency versions listed in the course repository to avoid breaking changes.

If you’re looking for the most up-to-date and fully supported version, we recommend Mastering Nuxt: Full Stack Unleashed , which uses Nuxt 4 and actively being maintained.