datamodel.prisma 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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. participants: [User]!
  25. ratings: [Rating]!
  26. published: Boolean!
  27. }
  28. type TrainingType {
  29. id: ID! @id
  30. name: String!
  31. description: String!
  32. }
  33. type Block {
  34. id: ID! @id
  35. sequence: Int!
  36. title: String!
  37. duration: Int!
  38. variation: String
  39. format: Format
  40. tracks: [Track]!
  41. excersises: [Excersise]!
  42. }
  43. type Format {
  44. id: ID! @id
  45. name: String!
  46. description: String!
  47. }
  48. type Track {
  49. id: ID! @id
  50. title: String!
  51. artist: String!
  52. duration: Int!
  53. link: String!
  54. }
  55. type Excersise {
  56. id: ID! @id
  57. name: String!
  58. description: String!
  59. video: String!
  60. targets: [String]! @scalarList(strategy: RELATION)
  61. }
  62. type Rating {
  63. id: ID! @id
  64. user: User!
  65. value: Int!
  66. comment: String!
  67. createdAt: DateTime! @createdAt
  68. }
  69. type Comment {
  70. id: ID! @id
  71. text: String!
  72. author: User!
  73. createdAt: DateTime! @createdAt
  74. }