I have this schema where there are multiple foreign keys pointing at User. When running npx prisma generate I get the error Did not find a relation for model User and field referralUser. Is this use case supported?
model User {
id Int @default(autoincrement()) @id
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
referralReferrer Referral[] @relation("referrer")
referralUser Referral[] @relation("user")
}
model Referral {
id Int @default(autoincrement()) @id
referrerId Int
referrer User @relation("referrer", fields: [referrerId], references: [id])
referralCode String
userId Int
user User @relation("user", fields: [userId], references: [id])
}
I have this schema where there are multiple foreign keys pointing at
User
. When runningnpx prisma generate
I get the errorDid not find a relation for model User and field referralUser
. Is this use case supported?