atas/docs/schema.dbml

98 lines
1.8 KiB
Plaintext
Raw Permalink Normal View History

2025-01-14 23:15:37 +01:00
//// ------------------------------------------------------
//// THIS FILE WAS AUTOMATICALLY GENERATED (DO NOT MODIFY)
//// ------------------------------------------------------
Project "AssetFlow" {
database_type: ''
Note: ''
}
2025-01-17 23:02:39 +01:00
Table alerts {
id Int [pk, increment]
type alertType [not null]
message String
actionplan actionPlan
actionplanId Int
date DateTime [not null]
state alertState [not null]
acknowledged_by alertContacts [not null]
acknowledged_at DateTime
}
Table alertContacts {
2025-01-14 23:15:37 +01:00
id Int [pk, increment]
name String [not null]
phone String [unique, not null]
comment String
2025-01-17 23:02:39 +01:00
prios priorities [not null]
alerts alerts [not null]
}
Table actionPlan {
id Int [pk, increment]
name String [not null]
comment String
alert_hook String [unique, not null]
prio priorities [not null]
content content [not null]
alerts alerts [not null]
2025-01-14 23:15:37 +01:00
}
2025-01-17 23:02:39 +01:00
Table priorities {
2025-01-14 23:15:37 +01:00
id Int [pk, increment]
2025-01-17 23:02:39 +01:00
Contact alertContacts [not null]
2025-01-14 23:15:37 +01:00
contactId Int [not null]
priority Int [not null]
2025-01-17 23:02:39 +01:00
actionplan actionPlan [not null]
2025-01-14 23:15:37 +01:00
actionplanId Int [not null]
indexes {
(priority, actionplanId) [unique]
}
}
2025-01-17 23:02:39 +01:00
Table content {
2025-01-14 23:15:37 +01:00
id Int [pk, increment]
type contentType [not null]
name String [not null]
filename String [not null]
2025-01-17 23:02:39 +01:00
actionplan actionPlan [not null]
}
Table alertContactsToalerts {
acknowledged_byId Int [ref: > alertContacts.id]
alertsId Int [ref: > alerts.id]
2025-01-14 23:15:37 +01:00
}
2025-01-17 23:02:39 +01:00
Table actionPlanTocontent {
contentId Int [ref: > content.id]
actionplanId Int [ref: > actionPlan.id]
2025-01-14 23:15:37 +01:00
}
Enum contentType {
voice_alarm
voice_explainer
voice_acknowledgement
voice_ending
}
2025-01-17 23:02:39 +01:00
Enum alertType {
generic
fire
fault
intrusion
clear
}
Enum alertState {
incomming
running
failed
acknowledged
}
Ref: alerts.actionplanId > actionPlan.id
Ref: priorities.contactId > alertContacts.id
2025-01-14 23:15:37 +01:00
2025-01-17 23:02:39 +01:00
Ref: priorities.actionplanId > actionPlan.id