🗃️ Add database schema
This commit is contained in:
@ -7,7 +7,49 @@ datasource db {
|
||||
url = env("DATABASE_URL")
|
||||
}
|
||||
|
||||
model test {
|
||||
key String @id
|
||||
value String
|
||||
}
|
||||
model Timetable {
|
||||
id Int @id @unique @default(autoincrement())
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
class String
|
||||
validFrom DateTime @default(now())
|
||||
validUntil DateTime?
|
||||
data Json
|
||||
}
|
||||
|
||||
model Substitution {
|
||||
id Int @id @unique @default(autoincrement())
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
class String[]
|
||||
date DateTime
|
||||
type String
|
||||
lesson Int
|
||||
changedTeacher String?
|
||||
changedRoom String?
|
||||
changedSubject 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
|
||||
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
|
||||
|
||||
SubstitutionChange SubstitutionChange[]
|
||||
}
|
||||
|
Reference in New Issue
Block a user