Skip to content
Discussion options

You must be logged in to vote

A reference to a discussion with relevant explanation - issue 1483

Prisma code with solution:

model User {
  id                  Int           @id @default(autoincrement())
  clientAppointment   Appointment[] @relation("clientUser")
  providerAppointment Appointment[] @relation("providerUser")
}

model Appointment {
  id             Int   @id @default(autoincrement())
  clientUser     User  @relation("clientUser", fields: [clientUserId], references: [id])
  clientUserId   Int
  providerUser   User? @relation("providerUser", fields: [providerUserId], references: [id])
  providerUserId Int
}

Thanks @pantharshit00

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@bananabrann
Comment options

@bananabrann
Comment options

Answer selected by mmsgov
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants