P
Prisma2mo ago
Paul

Prisma schema folder

I'm running v6. Is [schema folders] still in preview. I'm getting:
Error validating field `user` in model `DamFile`: The relation field `user` on model `DamFile` is missing an opposite relation field on the model `User`. Either run `prisma format` or add it manually.Prisma
Error validating field `user` in model `DamFile`: The relation field `user` on model `DamFile` is missing an opposite relation field on the model `User`. Either run `prisma format` or add it manually.Prisma
Seems it can't detect the other tables in adjacent schema files in the same folder.
Solution:
Running prisma format resolved the issue. What it did. I have no idea 🤷‍♂️
Jump to solution
2 Replies
Solution
Paul
Paul2mo ago
Running prisma format resolved the issue. What it did. I have no idea 🤷‍♂️
RaphaelEtim
RaphaelEtim2mo ago
Yes, the multi-file Prisma schema feature (also known as schema folders) is still in preview. The prisma format command is a tool that automatically formats your Prisma schema and can also add missing relation fields in certain cases. In your case, it added the missing opposite relation field on the model User.

Did you find this page helpful?