datamodel.prisma 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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. content: [Block]!
  23. createdAt: DateTime! @createdAt
  24. trainingDate: DateTime!
  25. location: String!
  26. registration: [User]!
  27. attendance: Int!
  28. ratings: [Rating]!
  29. published: Boolean!
  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. duration: Int!
  41. variation: String
  42. format: Format
  43. tracks: [Track]!
  44. exercises: [Exercise]!
  45. description: String!
  46. }
  47. type Format {
  48. id: ID! @id
  49. name: String!
  50. description: String!
  51. }
  52. type Track {
  53. id: ID! @id
  54. title: String!
  55. artist: String!
  56. duration: Int!
  57. link: String!
  58. }
  59. type Exercise {
  60. id: ID! @id
  61. name: String!
  62. description: String!
  63. video: String!
  64. targets: [String]! @scalarList(strategy: RELATION)
  65. baseExercise: BaseExercise!
  66. }
  67. type BaseExercise {
  68. id: ID! @id
  69. name: String!
  70. variations: [Exercise]!
  71. }
  72. type Rating {
  73. id: ID! @id
  74. user: User!
  75. value: Int!
  76. comment: String!
  77. createdAt: DateTime! @createdAt
  78. }
  79. type Comment {
  80. id: ID! @id
  81. text: String!
  82. author: User!
  83. createdAt: DateTime! @createdAt
  84. }