Is it neccessery to have Account model for Users model
I've been seeing this kind of pattern for Prisma's schemas. And wanted to know is this really necessary is this some standard that has some benefits that i don't see.
4 Replies
You don't need to have User and Profile separate since it looks like a 1:1 mapping. Only reason to have them separate is if you update User table often and don't want to lock up the Profile table or vice-versa. Although I'm not sure why you have password as a field since usually passwords are never stored only the salt and hashes are stored.
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
You're right I forgot you're using an orm. You can use a view and have Prisma map the view to an object to reduce the select repetition. I can see how User and Password are separate since you can put different permissions on the sql side to lock down any access.
Thanks for the explanation
I haven't figured out how to do auth in react 😅 yet or with what
But yeah i know we save only hash
I will probably update to having password model