Hey, could someone help me with <my issue>? Prisma...
# orm-help
t
Hey, could someone help me with my issue? Prisma started crashing on me, but after some debugging I think it's because my schema is wrong. I have a many-to-many relation, but it doesn't use the
id
field (the DB schema is out of my controll, so I can't change the way it works) and I don't know how to represent it in the schema. Essentialy what I need, is to tell prisma it should use something like
JOIN lbans_history lh ON lh.id = (SELECT MAX(lh.id) WHERE lh.uuid = lb.uuid ORDER BY date DESC)
when requesting a relation using
include: { history: true }
, but I'm not sure if this is even possible.