datamodel.prisma 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. type User {
  2. id: ID! @id
  3. email: String! @unique
  4. name: String!
  5. password: String!
  6. resetToken: String
  7. resetTokenExpiry: Float
  8. createdAt: DateTime! @createdAt
  9. comments: [Comment!]!
  10. ratings: [Rating!]!
  11. permissions: [Permission!]! @scalarList(strategy: RELATION)
  12. interests: [String!]! @scalarList(strategy: RELATION)
  13. }
  14. enum Permission {
  15. ADMIN
  16. INSTRUCTOR
  17. }
  18. type Training {
  19. id: ID! @id
  20. title: String!
  21. type: TrainingType!
  22. createdAt: DateTime! @createdAt
  23. trainingDate: DateTime!
  24. location: String
  25. registrations: [User!]!
  26. attendance: Int
  27. ratings: [Rating!]!
  28. published: Boolean!
  29. blocks: [BlockInstance!]!
  30. }
  31. type TrainingType {
  32. id: ID! @id
  33. name: String! @unique
  34. description: String!
  35. }
  36. type Block {
  37. id: ID! @id
  38. title: String!
  39. description: String
  40. videos: [String!]! @scalarList(strategy: RELATION)
  41. pictures: [String!]! @scalarList(strategy: RELATION)
  42. duration: Int
  43. format: Format!
  44. rest: Int
  45. tracks: [Track!]!
  46. blocks: [BlockInstance!]!
  47. exercises: [ExerciseInstance!]!
  48. }
  49. type BlockInstance {
  50. id: ID! @id
  51. block: Block!
  52. order: Int!
  53. rounds: Int
  54. variation: String
  55. }
  56. type Format {
  57. id: ID! @id
  58. name: String!
  59. description: String!
  60. }
  61. type Track {
  62. id: ID! @id
  63. title: String!
  64. artist: String!
  65. duration: Int!
  66. link: String!
  67. }
  68. type Exercise {
  69. id: ID! @id
  70. name: String!
  71. description: String!
  72. videos: [String!]! @scalarList(strategy: RELATION)
  73. pictures: [String!]! @scalarList(strategy: RELATION)
  74. targets: [String!]! @scalarList(strategy: RELATION)
  75. baseExercise: [String!]! @scalarList(strategy: RELATION)
  76. }
  77. type ExerciseInstance {
  78. id: ID! @id
  79. exercise: Exercise!
  80. order: Int!
  81. repetitions: Int
  82. variation: String
  83. }
  84. type Rating {
  85. id: ID! @id
  86. user: User!
  87. value: Int!
  88. comment: String!
  89. createdAt: DateTime! @createdAt
  90. }
  91. type Comment {
  92. id: ID! @id
  93. text: String!
  94. author: User!
  95. createdAt: DateTime! @createdAt
  96. }