Skip to content
Snippets Groups Projects
Select Git revision
  • 8f30188a88e099fc629e93e970137cc6c8930be0
  • main default protected
  • jw_sonar
  • v6.0.0 protected
  • bedran_exercise-list
  • ask-user-to-delete-exercises-on-duplicates
  • update-dependencies
  • jw_sonar_backup
  • add_route_assignments
  • 6.0.0-dev
  • 5.0.1
  • 5.0.0
  • 4.1.0
  • 4.0.0
  • 3.5.3
  • 3.5.2
  • 3.5.1
  • 3.5.0
  • 3.4.2
  • 3.4.1
  • 3.4.0
  • 3.3.0
  • 3.2.0
  • 3.1.3
  • 3.1.2
  • 3.1.1
  • 3.1.0
  • 3.0.1
  • 3.0.0
29 results

schema.prisma

Blame
  • schema.prisma 1.52 KiB
    generator client {
        provider = "prisma-client-js"
    }
    
    datasource db {
        provider = "mysql"
        url      = env("DATABASE_URL")
    }
    
    model User {
        id        Int     @id @default(autoincrement())
        firstname String
        lastname  String?
        mail      String? @unique
        password  String?
        gitlabId  Int     @unique
        role      String?
        deleted   Boolean @default(false)
    
        enonces   Enonce[]
        exercices Exercice[]
    }
    
    model Enonce {
        name               String   @id
        gitlabId           Int
        gitlabLink         String
        gitlabCreationInfo Json     @db.Json
        gitlabLastInfo     Json     @db.Json
        gitlabLastInfoDate DateTime
        published          Boolean  @default(false)
    
        exercices Exercice[]
        staff     User[]
    }
    
    model Exercice {
        id                 String   @id @db.Char(36)
        enonceName         String
        name               String
        secret             String   @unique @db.Char(36)
        gitlabId           Int
        gitlabLink         String
        gitlabCreationInfo Json     @db.Json
        gitlabLastInfo     Json     @db.Json
        gitlabLastInfoDate DateTime
    
        enonce Enonce @relation(fields: [enonceName], references: [name], onDelete: NoAction, onUpdate: Cascade)
    
        members User[]
        results Result[]
    }
    
    model Result {
        exerciceId String   @db.Char(36)
        dateTime   DateTime @default(now())
        pass       Boolean
        details    String   @db.Text
    
        exercice Exercice @relation(fields: [exerciceId], references: [id], onDelete: Cascade, onUpdate: Cascade)
    
        @@id([exerciceId, dateTime])
    }