bw-hspc-contest-env/web/prisma/schema.prisma

57 lines
1.2 KiB
Plaintext

generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
model User {
id Int @id @default(autoincrement())
username String @unique
password String
Submission Session[]
}
model Session {
token String @id
createdAt DateTime @default(now())
user User @relation(fields: [userId], references: [id])
userId Int
}
enum SubmissionState {
InReview
Correct
Incorrect
}
model Submission {
id Int @id @default(autoincrement())
createdAt DateTime @default(now())
state SubmissionState
actualOutput String
message String?
team Team @relation(fields: [teamId], references: [id])
teamId Int
problem Problem @relation(fields: [problemId], references: [id])
problemId Int
}
model Problem {
id Int @id @default(autoincrement())
friendlyName String @unique
sampleInput String
sampleOutput String
realInput String
realOutput String
Submission Submission[]
}
model Team {
id Int @id @default(autoincrement())
name String @unique
Submission Submission[]
}