ALESSIO
PPrisma
•Created by ALESSIO on 4/24/2025 in #help-and-questions
Relations on non unique fields
Hi guys, i'm building a new db and i need it to be multilingual. in order to achieve that i've created a contents table wich will handle every text/image for each language
Thanks to the content_id column i can join on the needed text and filter by language, that will come from the client
basically
id content_id language content
1 1 en hello
2 1 it ciao
3 1 es hola
Now i can create my challenges modules and have a relation with Contents module like this
but i get this error
Error parsing attribute "@relation": The argument
references
must refer to a unique criterion in the related model. Consider adding an @unique
attribute to the field content_id
in the model Contents
.Prisma
for each relation constraint.
How can i deal with this?6 replies