With prisma 1 can I define extra fields on a many-...
# orm-help
j
With prisma 1 can I define extra fields on a many-to-many relationship. As an example, lets say I have
Student
and
Class
types. A student can belong to many classes and a class has many students. That's easy to do, but what if I want to have an extra column on the studentOnClass table. Let's say I want to assign a seat number to every student in each class. How can I do it?
Havent tried that though. I usually just set up an intermediary model, like
AttendingStudent
j
I am familiar with relationtable but when I try to add info it complains that I mustn't add scalar data. Can you go into a little more detail about how you accomplish this task with an intermediatery table in Prisma data model?
l
ummm yeah .. you need another entity for this .. that is just the way data works. A relation is simply that a relation ... not data @joar is the option you want