Current section: Password 5 exercises

Creating an Optional Password Model in Prisma Schema

Loading exercise


00:00 Let's set up some password model data. So you're going to go to your Prisma schema and you're going to add a password model, but not a field in the user. No, it's got to be a model. And so one-to-one model. And yeah, that's kind of interesting actually because you cannot make it a required field.

00:18 It has to be optional just because database constraints don't allow you to make it not optional. And at first glance, I might feel like that's not a good idea or that there's something missing there. But later on, we'll find out that's actually just fine. So go ahead and create that password model and we'll see you when you're done.