Tomáš Kallup
07/14/2021, 8:28 AMid
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.