feat(prisma): add Template model and EditorLanguage enum to support problem templates and code language options

This commit is contained in:
cfngc4594 2025-03-08 20:42:01 +08:00
parent 944c5407bd
commit 8c159e2717

View File

@ -36,4 +36,18 @@ model Problem {
published Boolean @default(false) published Boolean @default(false)
authorId Int authorId Int
author User @relation(fields: [authorId], references: [id]) 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])
} }