123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265 |
- // This is your Prisma schema file
- // learn more about it in the docs: https://pris.ly/d/prisma-schema
- generator client {
- provider = "prisma-client-js"
- }
- datasource db {
- provider = "postgresql"
- url = env("DATABASE_URL")
- }
- enum UserRole {
- admin
- user
- }
- model User {
- id String @id
- firstName String @default("")
- lastName String @default("")
- name String
- email String @unique
- emailVerified Boolean
- image String?
- locale String? @default("fr")
- createdAt DateTime
- updatedAt DateTime
- sessions Session[]
- accounts Account[]
- feedbacks Feedbacks[]
- role UserRole? @default(user)
- banned Boolean? @default(false)
- banReason String?
- banExpires DateTime?
- @@map("user")
- }
- model Session {
- id String @id
- expiresAt DateTime
- token String @unique
- createdAt DateTime
- updatedAt DateTime
- ipAddress String?
- userAgent String?
- userId String
- user User @relation(fields: [userId], references: [id], onDelete: Cascade)
- impersonatedBy String?
- @@map("session")
- }
- model Account {
- id String @id
- accountId String
- providerId String
- userId String
- user User @relation(fields: [userId], references: [id], onDelete: Cascade)
- accessToken String?
- refreshToken String?
- idToken String?
- accessTokenExpiresAt DateTime?
- refreshTokenExpiresAt DateTime?
- scope String?
- password String?
- createdAt DateTime
- updatedAt DateTime
- @@map("account")
- }
- model Verification {
- id String @id
- identifier String
- value String
- expiresAt DateTime
- createdAt DateTime?
- updatedAt DateTime?
- @@map("verification")
- }
- model Feedbacks {
- id String @id @default(cuid())
- review Int
- message String
- email String?
- userId String?
- user User? @relation(fields: [userId], references: [id], onDelete: SetNull)
- createdAt DateTime @default(now())
- updatedAt DateTime @updatedAt
- @@map("feedbacks")
- }
- model Exercise {
- id String @id @default(cuid())
- name String
- nameEn String?
- description String? @db.Text
- descriptionEn String? @db.Text
- fullVideoUrl String? @db.Text
- fullVideoImageUrl String? @db.Text
- introduction String? @db.Text
- introductionEn String? @db.Text
- slug String? @unique
- slugEn String? @unique
- createdAt DateTime @default(now())
- updatedAt DateTime @updatedAt
- // Relations
- attributes ExerciseAttribute[]
- @@map("exercises")
- }
- model ExerciseAttributeName {
- id String @id @default(cuid())
- name ExerciseAttributeNameEnum @unique
- createdAt DateTime @default(now())
- updatedAt DateTime @updatedAt
- // Relations
- values ExerciseAttributeValue[]
- attributes ExerciseAttribute[]
- @@map("exercise_attribute_names")
- }
- model ExerciseAttributeValue {
- id String @id @default(cuid())
- attributeNameId String
- value ExerciseAttributeValueEnum
- createdAt DateTime @default(now())
- updatedAt DateTime @updatedAt
- // Relations
- attributeName ExerciseAttributeName @relation(fields: [attributeNameId], references: [id])
- attributes ExerciseAttribute[]
- @@unique([attributeNameId, value])
- @@map("exercise_attribute_values")
- }
- model ExerciseAttribute {
- id String @id @default(cuid())
- exerciseId String
- attributeNameId String
- attributeValueId String
- createdAt DateTime @default(now())
- updatedAt DateTime @updatedAt
- // Relations
- exercise Exercise @relation(fields: [exerciseId], references: [id], onDelete: Cascade)
- attributeName ExerciseAttributeName @relation(fields: [attributeNameId], references: [id])
- attributeValue ExerciseAttributeValue @relation(fields: [attributeValueId], references: [id])
- @@unique([exerciseId, attributeNameId, attributeValueId])
- @@map("exercise_attributes")
- }
- // Enums
- enum ExercisePrivacy {
- PUBLIC
- PRIVATE
- }
- // Noms d'attributs
- enum ExerciseAttributeNameEnum {
- TYPE
- PRIMARY_MUSCLE
- SECONDARY_MUSCLE
- EQUIPMENT
- MECHANICS_TYPE
- }
- // Toutes les valeurs possibles
- enum ExerciseAttributeValueEnum {
- // Types d'exercices
- BODYWEIGHT
- STRENGTH
- POWERLIFTING
- CALISTHENIC
- PLYOMETRICS
- STRETCHING
- STRONGMAN
- CARDIO
- STABILIZATION
- POWER
- RESISTANCE
- CROSSFIT
- WEIGHTLIFTING
- // Groupes musculaires
- BICEPS
- SHOULDERS
- CHEST
- BACK
- GLUTES
- TRICEPS
- HAMSTRINGS
- QUADRICEPS
- FOREARMS
- CALVES
- TRAPS
- ABDOMINALS
- NECK
- LATS
- ADDUCTORS
- ABDUCTORS
- OBLIQUES
- GROIN
- FULL_BODY
- ROTATOR_CUFF
- HIP_FLEXOR
- ACHILLES_TENDON
- FINGERS
- // Équipements
- DUMBBELL
- KETTLEBELLS
- BARBELL
- SMITH_MACHINE
- BODY_ONLY
- OTHER
- BANDS
- EZ_BAR
- MACHINE
- DESK
- PULLUP_BAR
- NONE
- CABLE
- MEDICINE_BALL
- SWISS_BALL
- FOAM_ROLL
- WEIGHT_PLATE
- TRX
- BOX
- ROPES
- SPIN_BIKE
- STEP
- BOSU
- TYRE
- SANDBAG
- POLE
- BENCH
- WALL
- BAR
- RACK
- CAR
- SLED
- CHAIN
- SKIERG
- ROPE
- NA
- // Types de mécanique
- ISOLATION
- COMPOUND
- }
|