Need help with setting up prisma schemas

so basically I want a user to be able to create and join events. I've set up a way to identify the host of an event, but not how to keep track of the members of the event (those who join the event). I kept getting some errors when I tried to implement it myself and it was hard to keep track of them so i got rid of what i had cause it was not working. What is a good way of keeping track of Users who join the event?
model User {
  id            String    @id @default(cuid())
  name          String?
  email         String?   @unique
  emailVerified DateTime?
  image         String?
  accounts      Account[]
  sessions      Session[]
  hostedEvents  Event[]   @relation(name: "hostEvent")
}

model Event {
  id          String    @id @default(cuid())
  name        String
  description String
  startDate   DateTime
  endDate     DateTime
  location    String
  link        String
  createdAt   DateTime  @default(now())
  updatedAt   DateTime  @updatedAt
  hostId      String
  host        User      @relation("hostEvent", fields: [hostId], references: [id])
  Gallery     Gallery[]
}
Was this page helpful?