mirror of
https://github.com/cfngc4594/monaco-editor-lsp-next.git
synced 2025-05-18 15:26:36 +00:00
feat(prisma): add TestcaseResult model and relations to Submission and Testcase
This commit is contained in:
parent
d64f95b4e7
commit
1c0612372b
@ -141,6 +141,8 @@ model Submission {
|
|||||||
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||||
problem Problem @relation(fields: [problemId], references: [id], onDelete: Cascade)
|
problem Problem @relation(fields: [problemId], references: [id], onDelete: Cascade)
|
||||||
|
|
||||||
|
TestcaseResult TestcaseResult[]
|
||||||
|
|
||||||
createdAt DateTime @default(now())
|
createdAt DateTime @default(now())
|
||||||
updatedAt DateTime @updatedAt
|
updatedAt DateTime @updatedAt
|
||||||
}
|
}
|
||||||
@ -151,16 +153,35 @@ model Testcase {
|
|||||||
problem Problem @relation(fields: [problemId], references: [id], onDelete: Cascade)
|
problem Problem @relation(fields: [problemId], references: [id], onDelete: Cascade)
|
||||||
data TestcaseData[]
|
data TestcaseData[]
|
||||||
expectedOutput String
|
expectedOutput String
|
||||||
|
TestcaseResult TestcaseResult[]
|
||||||
}
|
}
|
||||||
|
|
||||||
model TestcaseData {
|
model TestcaseData {
|
||||||
id String @id @default(cuid())
|
id String @id @default(cuid())
|
||||||
|
index Int
|
||||||
label String
|
label String
|
||||||
value String
|
value String
|
||||||
testcaseId String
|
testcaseId String
|
||||||
testcase Testcase @relation(fields: [testcaseId], references: [id], onDelete: Cascade)
|
testcase Testcase @relation(fields: [testcaseId], references: [id], onDelete: Cascade)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
model TestcaseResult {
|
||||||
|
id String @id @default(cuid())
|
||||||
|
isCorrect Boolean
|
||||||
|
output String
|
||||||
|
|
||||||
|
executionTime Int?
|
||||||
|
memoryUsage Int?
|
||||||
|
|
||||||
|
submissionId String
|
||||||
|
testcaseId String
|
||||||
|
submission Submission @relation(fields: [submissionId], references: [id], onDelete: Cascade)
|
||||||
|
testcase Testcase @relation(fields: [testcaseId], references: [id], onDelete: Cascade)
|
||||||
|
|
||||||
|
createdAt DateTime @default(now())
|
||||||
|
updatedAt DateTime @updatedAt
|
||||||
|
}
|
||||||
|
|
||||||
model Account {
|
model Account {
|
||||||
userId String
|
userId String
|
||||||
type String
|
type String
|
||||||
|
Loading…
Reference in New Issue
Block a user