91 lines
2.2 KiB
Plaintext
91 lines
2.2 KiB
Plaintext
generator client {
|
|
provider = "prisma-client-js"
|
|
}
|
|
|
|
datasource db {
|
|
provider = "postgresql"
|
|
url = env("DATABASE_URL")
|
|
}
|
|
|
|
model Timetable {
|
|
id Int @id @unique @default(autoincrement())
|
|
title String @default("Default")
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
class String
|
|
validFrom DateTime @default(now())
|
|
validUntil DateTime?
|
|
data Json
|
|
source String?
|
|
trusted Boolean @default(true)
|
|
}
|
|
|
|
model Substitution {
|
|
id Int @id @unique @default(autoincrement())
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
class String[]
|
|
date DateTime
|
|
type String
|
|
lesson Int
|
|
teacher String
|
|
changedTeacher String?
|
|
changedRoom String?
|
|
changedSubject String?
|
|
notes String?
|
|
removed Boolean @default(false)
|
|
|
|
SubstitutionChange SubstitutionChange[]
|
|
}
|
|
|
|
model SubstitutionChange {
|
|
id Int @id @unique @default(autoincrement())
|
|
createdAt DateTime @default(now())
|
|
substitution Substitution @relation(fields: [substitutionId], references: [id])
|
|
substitutionId Int
|
|
type String
|
|
teacher String?
|
|
changes Json?
|
|
parseEvent ParseEvent @relation(fields: [parseEventId], references: [id])
|
|
parseEventId Int
|
|
}
|
|
|
|
model ParseEvent {
|
|
id Int @id @unique @default(autoincrement())
|
|
createdAt DateTime @default(now())
|
|
logFile String
|
|
originalData String
|
|
duration Int
|
|
succeeded Boolean
|
|
|
|
SubstitutionChange SubstitutionChange[]
|
|
}
|
|
|
|
model Class {
|
|
name String @id @unique
|
|
regex String
|
|
}
|
|
|
|
model Time {
|
|
lesson Int @unique
|
|
start DateTime
|
|
end DateTime
|
|
}
|
|
|
|
model Session {
|
|
token String @id @unique @default(uuid())
|
|
createdAt DateTime @default(now())
|
|
validUntil DateTime
|
|
appliedKeys Key[]
|
|
}
|
|
|
|
model Key {
|
|
key String @id @unique @default(uuid())
|
|
createdAt DateTime? @default(now())
|
|
validUntil DateTime?
|
|
permissions String[]
|
|
notes String?
|
|
Session Session? @relation(fields: [sessionToken], references: [token])
|
|
sessionToken String?
|
|
}
|