mirror of
https://github.com/massbug/judge4c.git
synced 2025-05-17 23:12:23 +00:00
feat(prisma): add user and problem relations to Submission model
This commit is contained in:
parent
895c3f779d
commit
7dbf06b99f
@ -32,6 +32,7 @@ model User {
|
||||
|
||||
role Role @default(GUEST)
|
||||
problems Problem[]
|
||||
Submission Submission[]
|
||||
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
@ -53,11 +54,11 @@ model Problem {
|
||||
published Boolean @default(false)
|
||||
userId String
|
||||
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||
templates Template[]
|
||||
testcases Testcase[]
|
||||
|
||||
timeLimit Int @default(1000)
|
||||
memoryLimit Int @default(128)
|
||||
templates Template[]
|
||||
testcases Testcase[]
|
||||
Submission Submission[]
|
||||
|
||||
@@index([userId])
|
||||
@@index([difficulty])
|
||||
@ -110,23 +111,38 @@ model Template {
|
||||
@@id([problemId, language])
|
||||
}
|
||||
|
||||
enum ExitCode {
|
||||
SE // System Error
|
||||
CS // Compilation Success
|
||||
enum Status {
|
||||
PD // PENDING
|
||||
QD // QUEUED
|
||||
CP // COMPILING
|
||||
CE // Compilation Error
|
||||
CS // Compilation Success
|
||||
RU // RUNNING
|
||||
TLE // Time Limit Exceeded
|
||||
MLE // Memory Limit Exceeded
|
||||
RE // Runtime Error
|
||||
AC // Accepted
|
||||
WA // Wrong Answer
|
||||
SE // System Error
|
||||
}
|
||||
|
||||
model JudgeResult {
|
||||
model Submission {
|
||||
id String @id @default(cuid())
|
||||
output String
|
||||
exitCode ExitCode
|
||||
language EditorLanguage
|
||||
code String
|
||||
status Status
|
||||
message String?
|
||||
executionTime Int?
|
||||
memoryUsage Int?
|
||||
|
||||
userId String
|
||||
problemId String
|
||||
|
||||
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||
problem Problem @relation(fields: [problemId], references: [id], onDelete: Cascade)
|
||||
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
model Testcase {
|
||||
|
Loading…
Reference in New Issue
Block a user