Is it possible to establish a one-way m-to-n relationship without requiring both collections to have each other's ids? I am attempting the following:
model Country {
id String @id @default(auto()) @map("_id") @db.ObjectId
name String @unique
users User[]
}
model User {
id String @id @default(auto()) @map("_id") @db.ObjectId
userName String @unique
countryIds String[] @db.ObjectId
countries Country[] @relation(fields: [countryIds], references: [id])
// ....
}
However, Prisma is forcing me to add another field to Country
to store the user ids... Like this:
model Country {
id String @id @default(auto()) @map("_id") @db.ObjectId
name String @unique
userIds String[] @db.ObjectId
users Player[] @relation(fields: [userIds], references: [id])
}
I do not require that data and it does not make sense logically. Is there a way to avoid this? Any potential workarounds?