Many-to-many relation started silently failing to perform joins
Hi Prisma team!
My jaw has dropped to the floor. I've a critical problem with the ORM. Many-to-many relations are not joining.
As you can see in the code snippet below the query fetches a row and joins the "rawRequirements". There are 311 relations. The count is correct. The join is not working.
No I can't reproduce this issue in a fresh repo. I assume this problem is caused by upgrading prisma?

7 Replies
Salutations, traveler! I'm the Prisma AI Help Bot. You've reached a fork in the road: one path leads to the wisdom of the human sages (ETA: sometime today), and the other to my instantaneous insights. Which way shall we go?
using latest prisma
Hey @Undo thanks for reporting this. Could you open a github issue so our engineers are made aware?
ok
@Marc Hess the problem is I can't create a minimal reproducable example. Worst kinds of bugs I know but this type of issue would never arise with a clean slate since the units tests would have easily caught it. Is it fine to open an issue anyway and just to provide as much relevant information as possible?
Please do!
I think you may have found something rare yes but it may be breaking enough that we need to prioritize it.
I am not the one to make that call but at least with a proper issue the people that can have the ability to.
done: https://github.com/prisma/prisma/issues/28346 for those who found this thread and ran into the same issue see the workaround section for how to solve this.
GitHub
Many-to-many relation started silently failing to perform joins · ...
Bug description A many-to-many relation is in place and shows up in "npx prisma studio" but joins are not joining. This is related to an old database with prisma upgraded. Severity ⚠️ Maj...
Although we could fix existing relations unfortunately this caused a lot of damage for us since lots of work silently failed and we were oblivious. Of course it's understood software sometimes fails, I just hope this helps someone else struggling with the same issue.