Hi, is there a way to define a one-to-one relation...
# prisma-client
y
Hi, is there a way to define a one-to-one relation based on 2 fields? I'd like to relate the 
User
 and 
InternalUserProfile
 only when 
User.type = INTERNAL
.
Copy code
model User {
  id                  Int                  @id @default(autoincrement())
  type                UserType
  internalUserProfile InternalUserProfile?
}

model InternalUserProfile {
  user   User @relation(fields: [userId = User.id AND User.type = 'INTERNAL'], references: [id])
  userId Int
}

enum UserType {
  INTERNAL
  EXTERNAL
}
Thank you!