Are these Prisma models okay?

Hey I'm trying out prisma and I'm attempting to make a bug tracker. Just wondering if these models seem fine or if there's anything I can do to make them "better". Most bug trackers have a bunch of different roles but I'm new to this so I'm keeping it simple with just a user and an admin (me). Then a project manager which is just the user who created the project so they wouldn't have a role the actual project would have a manager and a user would have a list of projects they manage I think? For the user model I haven't hooked up NextAuth or anything yet so I'll probably have more fields when I get that far. Just trying to get the initial setup goin. I've seen examples with Account and User with a bunch of information that comes from NextAuth. For the BugHistory I assume it has fields that can be edited from Bug but also includes the id of a user that updated it and its id is the bug being updated. Or does it have both its own id and an id of the bug being updated? Not really sure how this will work yet. If a user updates the description of a bug I would only want to know that the description was updated and not the rest of the information right? So I'm not sure how I'll display only updated fields in the future. Eventually I'll need a way for project managers to invite a user to a project. I'll figure that out eventually. hopefully. Edit: Just found out something called an Audit table. Not entirely sure how it would be structured or how I would implement it in NextJs but possibly like id, table, field, recordId, oldValue, newValue, updatedBy, updatedAt. Images:
2 Replies
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
EXILE
EXILE2y ago
I'll check it out in a bit thanks
Want results from more Discord servers?
Add your server