datamodel.prisma 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. type User {
  2. id: ID! @id
  3. email: String! @unique
  4. name: String!
  5. password: String!
  6. createdAt: DateTime! @createdAt
  7. comments: [Comment]!
  8. ratings: [Rating]!
  9. permissions: [Permission]! @scalarList(strategy: RELATION)
  10. interests: [String]! @scalarList(strategy: RELATION)
  11. }
  12. enum Permission {
  13. ADMIN
  14. INSTRUCTOR
  15. USER
  16. }
  17. type Training {
  18. id: ID! @id
  19. title: String!
  20. type: TrainingType!
  21. content: [Block]!
  22. createdAt: DateTime! @createdAt
  23. trainingDate: DateTime!
  24. location: String!
  25. registration: [User]!
  26. attendance: Int!
  27. ratings: [Rating]!
  28. published: Boolean!
  29. }
  30. type TrainingType {
  31. id: ID! @id
  32. name: String! @unique
  33. description: String!
  34. }
  35. type Block {
  36. id: ID! @id
  37. sequence: Int!
  38. title: String!
  39. duration: Int!
  40. variation: String
  41. format: Format
  42. tracks: [Track]!
  43. exercises: [Exercise]!
  44. description: String!
  45. }
  46. type Format {
  47. id: ID! @id
  48. name: String!
  49. description: String!
  50. }
  51. type Track {
  52. id: ID! @id
  53. title: String!
  54. artist: String!
  55. duration: Int!
  56. link: String!
  57. }
  58. type Exercise {
  59. id: ID! @id
  60. name: String!
  61. description: String!
  62. video: String!
  63. targets: [String]! @scalarList(strategy: RELATION)
  64. baseExercise: BaseExercise!
  65. }
  66. type BaseExercise {
  67. id: ID! @id
  68. name: String!
  69. variations: [Exercise]!
  70. }
  71. type Rating {
  72. id: ID! @id
  73. user: User!
  74. value: Int!
  75. comment: String!
  76. createdAt: DateTime! @createdAt
  77. }
  78. type Comment {
  79. id: ID! @id
  80. text: String!
  81. author: User!
  82. createdAt: DateTime! @createdAt
  83. }