Reputation: 7230
While trying to declare some mappings on Prisma, we are running into a problem: the library does not accept declaring a many-to-one without declaring an one-to-many on the other side, which could get very messy if you have a large, complex model.
Is there a way to use just the many-to-one without a corresponding one-to-many?
Why does this library has such restriction? Wouldn't such requirement hurt scalability?
Upvotes: 1
Views: 680
Reputation: 7568
It's not possible as of now to declare unidirectional relations in Prisma.
There is no way to tell Prisma to prevent relationship fields on both sides.
This is by design as you might need to fetch data from any one side of the relationship which is why the virtual field is required.
I would suggest creating a Feature Request explaining your use case.
Upvotes: 1