Hi, is there some docs that show a good pattern fo...
# orm-help
c
Hi, is there some docs that show a good pattern for two tables that are joined and that join table might need additional columns? Use case: Users table, Groups table. Users can belong to groups. Users that belong to a group might also be an admin of that group, so an
isAdmin
column on that join table might be handy.
j
could you add a one-to-one group-user relation on the group called
admin
?
c
Yes, that’s what we were thinking but I just wanted to confirm there wasn’t a more Prisma/GraphQL way of doing it.
j
i think the prisma way is to let it make the join tables for you
c
And put
isAdmin
on a one-to-many relationship?
j
depends if you want more than one admin
c
Yes