PrismaP
Prisma11mo ago
10 replies
ptrxyz

n:m relations between tables and view

I have a view "DepartmentInfo" as well as model "User".

The user can be part of many departments and a department can have many users -- we are talking about n:m relation.


I defined the view as well as the model in my schema, but prisma doesn't seem to create the relation tables (_User_DepartmentInfo) for that relation. As soon as I change the view to a model, the table is generated.


What am I doing wrong here?
Was this page helpful?