Yaakov
01/25/2022, 5:41 PMUser and InternalUserProfile only when User.type = INTERNAL.
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!