datamodel.prisma 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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: [Block!]!
  30. }
  31. type TrainingType {
  32. id: ID! @id
  33. name: String! @unique
  34. description: String!
  35. }
  36. type Block {
  37. id: ID! @id
  38. sequence: Int!
  39. title: String!
  40. description: String
  41. videos: [String!]! @scalarList(strategy: RELATION)
  42. pictures: [String!]! @scalarList(strategy: RELATION)
  43. duration: Int
  44. rounds: Int
  45. format: Format!
  46. rest: Int
  47. tracks: [Track!]!
  48. blocks: [Block!]!
  49. exercises: [ExerciseInstance!]!
  50. }
  51. type Format {
  52. id: ID! @id
  53. name: String!
  54. description: String!
  55. }
  56. type Track {
  57. id: ID! @id
  58. title: String!
  59. artist: String!
  60. duration: Int!
  61. link: String!
  62. }
  63. type ExerciseInstance {
  64. id: ID! @id
  65. exercise: Exercise!
  66. repetitions: Int
  67. }
  68. type Exercise {
  69. id: ID! @id
  70. name: String!
  71. description: String!
  72. video: String!
  73. targets: [String!]! @scalarList(strategy: RELATION)
  74. baseExercise: [String!]! @scalarList(strategy: RELATION)
  75. }
  76. type Rating {
  77. id: ID! @id
  78. user: User!
  79. value: Int!
  80. comment: String!
  81. createdAt: DateTime! @createdAt
  82. }
  83. type Comment {
  84. id: ID! @id
  85. text: String!
  86. author: User!
  87. createdAt: DateTime! @createdAt
  88. }