mirror of
https://github.com/cfngc4594/monaco-editor-lsp-next.git
synced 2025-05-18 15:26:36 +00:00
55 lines
993 B
Plaintext
55 lines
993 B
Plaintext
generator client {
|
|
provider = "prisma-client-js"
|
|
}
|
|
|
|
datasource db {
|
|
provider = "postgresql"
|
|
url = env("DATABASE_URL")
|
|
}
|
|
|
|
enum Role {
|
|
ADMIN
|
|
TEACHER
|
|
STUDENT
|
|
GUEST
|
|
}
|
|
|
|
model User {
|
|
id Int @id @default(autoincrement())
|
|
name String @unique
|
|
email String @unique
|
|
role Role @default(GUEST)
|
|
problems Problem[]
|
|
}
|
|
|
|
enum Difficulty {
|
|
EASY
|
|
MEDIUM
|
|
HARD
|
|
}
|
|
|
|
model Problem {
|
|
id Int @id @default(autoincrement())
|
|
title String
|
|
description String
|
|
solution String
|
|
difficulty Difficulty @default(EASY)
|
|
published Boolean @default(false)
|
|
authorId Int
|
|
author User @relation(fields: [authorId], references: [id])
|
|
templates Template[]
|
|
}
|
|
|
|
enum EditorLanguage {
|
|
c
|
|
cpp
|
|
}
|
|
|
|
model Template {
|
|
id Int @id @default(autoincrement())
|
|
language EditorLanguage
|
|
template String
|
|
problemId Int
|
|
problem Problem @relation(fields: [problemId], references: [id])
|
|
}
|