monaco-editor-lsp-next/prisma/schema.prisma

54 lines
972 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
difficulty Difficulty @default(EASY)
published Boolean @default(false)
authorId Int
author User @relation(fields: [authorId], references: [id])
Template 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])
}