schema updates

This commit is contained in:
2025-02-03 22:23:37 +01:00
parent 2e8ee7ca5c
commit 8383080395
3 changed files with 78 additions and 43 deletions

View File

@ -26,7 +26,7 @@ generator dbml {
provider = "prisma-dbml-generator"
output = "../docs"
outputName = "schema.dbml"
projectName = "AssetFlow"
projectName = "ATAS"
}
@ -46,70 +46,74 @@ enum alertType {
}
enum alertState {
incomming // Incomming alerts
running // Started calling
failed // Failed to get acknowledgement of any alertContacts
acknowledged // Some user acknowledged alert
incoming // Incoming alerts
running // Started calling
failed // Failed to get acknowledgement of any alertContacts
acknowledged // Some user acknowledged alert
}
model alerts {
id Int @id @unique @default(autoincrement())
type alertType
message String?
actionplan actionPlan? @relation(fields: [actionplanId], references: [id])
actionplanId Int?
date DateTime
id Int @id @unique @default(autoincrement())
type alertType
state alertState
description String?
date DateTime
actionplan actionPlan? @relation(fields: [actionplanId], references: [id])
actionplanId Int?
acknowledged_by alertContacts[]
acknowledged_at DateTime?
@@fulltext([message])
@@fulltext([description])
}
model alertContacts {
id Int @id @unique @default(autoincrement())
id Int @id @unique @default(autoincrement())
name String
phone String @unique
phone String @unique
comment String?
prios priorities[]
alerts alerts[]
alerts alerts[]
@@fulltext([name, phone, comment])
}
model actionPlan {
id Int @id @unique @default(autoincrement())
name String
comment String?
alert_hook String @unique
prio priorities[]
content content[] // aka. all voice files
id Int @id @unique @default(autoincrement())
name String @unique
comment String?
alerthook String @unique
prio priorities[]
content content[] // aka. all voice files
alerts alerts[]
@@fulltext([name, comment])
}
model priorities {
id Int @id @unique @default(autoincrement())
Contact alertContacts @relation(fields: [contactId], references: [id])
contactId Int
priority Int
actionplan actionPlan @relation(fields: [actionplanId], references: [id])
actionplanId Int
id Int @id @unique @default(autoincrement())
Contact alertContacts @relation(fields: [contactId], references: [id])
contactId Int
priority Int
actionplan actionPlan @relation(fields: [actionplanId], references: [id])
actionplanId Int
@@unique([priority, actionplanId])
}
model content {
id Int @id @unique @default(autoincrement())
type contentType
name String
filename String
actionplan actionPlan[]
id Int @id @unique @default(autoincrement())
type contentType
name String
filename String
actionplan actionPlan[]
@@fulltext([name, filename])
}
// https://spacecdn.de/file/bma_stoe_v1.mp3
// https://spacecdn.de/file/quittiert_v1.mp3
// https://spacecdn.de/file/angenehmen_tag_v1.mp3