I have a Post and Comment models. I want to create...
# orm-help
a
I have a Post and Comment models. I want to create a Vote model I can use for my Posts/Comments. How would I achieve something like this? I'm having a hard time wrapping my head around it
Copy code
model User {
  id ...
  createdAt ...
  updatedAt ...
  username ...
  email ...
  password ...
  karma Int @default(0) // count of the number of votes a users posts/comments have
  posts Post[]
  comments [] 
}

model Post {
  id ...
  createdAt ...
  updatedAt ...
  title ...
  body ...
  votes ???
}

model Comment {
  id ...
  createdAt ...
  updatedAt ...
  text ...
  votes ???
}
r
@Awey 👋 Do you just want to store the number of votes or do you also want to store the specific User that voted the Comment?