datamodel.prisma 626 B

1234567891011121314151617181920212223242526272829303132
  1. type User {
  2. id: ID! @unique
  3. email: String! @unique
  4. name: String!
  5. abbreviation: String!
  6. password: String!
  7. comments: [Comment]! @relation(name: "CommentAuthor", onDelete: CASCADE)
  8. }
  9. type Comment {
  10. id: ID! @unique
  11. text: String!
  12. createdAt: DateTime!
  13. author: User! @relation(name: "CommentAuthor", onDelete: SET_NULL)
  14. }
  15. type Training {
  16. id: ID! @unique
  17. title: String!
  18. content: String!
  19. createdAt: DateTime!
  20. trainingDate: DateTime!
  21. participants: [User]!
  22. ratings: [Rating]!
  23. }
  24. type Rating {
  25. id: ID! @unique
  26. user: User!
  27. value: Int!
  28. comment: String!
  29. }