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

52 lines
1000 B
Plaintext
Raw Normal View History

2023-04-27 22:26:54 -04:00
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
model User {
2023-04-28 13:42:16 -04:00
id Int @id @default(autoincrement())
username String @unique
2023-04-27 22:26:54 -04:00
password String
2023-04-28 13:42:16 -04:00
sessions Session[]
}
model Session {
token String @id
createdAt DateTime @default(now())
user User @relation(fields: [userId], references: [id])
userId Int
2023-04-27 22:26:54 -04:00
}
2023-04-28 10:30:46 -04:00
enum SubmissionState {
InReview
Correct
Incorrect
}
model Submission {
2023-04-28 15:01:03 -04:00
id Int @id @default(autoincrement())
createdAt DateTime @default(now())
state SubmissionState
expectedOutput String
actualOutput String
message String?
2023-04-28 10:30:46 -04:00
}
2023-04-28 20:06:28 -04:00
model Problem {
id Int @id @default(autoincrement())
2023-04-29 11:42:35 -04:00
friendlyName String @unique
2023-04-28 20:06:28 -04:00
sampleInput String
sampleOutput String
realInput String
realOutput String
}
2023-04-29 11:42:35 -04:00
model Team {
id Int @id @default(autoincrement())
name String @unique
}