Skip to content

Commit af8d048

Browse files
authored
Updated db_diagram and link to dbdiagram.io (#542)
1 parent ed87c2a commit af8d048

2 files changed

Lines changed: 40 additions & 5 deletions

File tree

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ The back-end core feature is to interact with the metadata tables. For the servi
2424

2525
- Webhook: stores the webhook URLs.
2626

27-
_The UML is versioned at [`scripts/dbdiagram.txt`](https://github.com/pyronear/pyro-api/blob/main/scripts/dbdiagram.txt) and the UML diagram is available on [DBDiagram](https://dbdiagram.io/d/Pyronear-Alert-Schema-671e1b9897a66db9a3673d76)._
27+
_The UML is versioned at [`scripts/dbdiagram.txt`](https://github.com/pyronear/pyro-api/blob/main/scripts/dbdiagram.txt) and the UML diagram is available on [DBDiagram](https://dbdiagram.io/d/pyronear-alert-api-db-diagram-6931c25bd6676488baa1d700)._
2828

2929
### What is the full detection workflow through the API
3030

scripts/dbdiagram.txt

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@ Table "sequences" as S {
6767
"id" int [not null]
6868
"camera_id" int [ref: > C.id, not null]
6969
"pose_id" int [ref: > P.id]
70-
"azimuth" float [not null]
70+
"camera_azimuth" float [not null]
71+
"sequence_azimuth" float
72+
"cone_angle" float
7173
"is_wildfire" annotationtype
7274
"started_at" timestamp [not null]
7375
"last_seen_at" timestamp [not null]
@@ -80,11 +82,11 @@ Table "sequences" as S {
8082
Table "detections" as D {
8183
"id" int [not null]
8284
"camera_id" int [ref: > C.id, not null]
83-
"pose_id" int [ref: > P.id]
85+
"pose_id" int [ref: > P.id, not null]
8486
"sequence_id" int [ref: > S.id]
85-
"azimuth" float [not null]
8687
"bucket_key" varchar [not null]
87-
"bboxes" varchar [not null]
88+
"bbox" varchar [not null]
89+
"others_bboxes" varchar
8890
"created_at" timestamp [not null]
8991

9092
Indexes {
@@ -100,3 +102,36 @@ Table "webhooks" as W {
100102
(id) [pk]
101103
}
102104
}
105+
106+
Table "occlusion_masks" as OM {
107+
"id" int [not null]
108+
"pose_id" int [ref: > P.id, not null]
109+
"mask" varchar [not null]
110+
"created_at" timestamp [not null]
111+
112+
Indexes {
113+
(id) [pk]
114+
}
115+
}
116+
117+
Table "alerts" as A {
118+
"id" int [not null]
119+
"organization_id" int [ref: > O.id, not null]
120+
"lat" float
121+
"lon" float
122+
"started_at" timestamp [not null]
123+
"last_seen_at" timestamp [not null]
124+
125+
Indexes {
126+
(id) [pk]
127+
}
128+
}
129+
130+
Table "alerts_sequences" as AS {
131+
"alert_id" int [ref: > A.id, not null]
132+
"sequence_id" int [ref: > S.id, not null]
133+
134+
Indexes {
135+
(alert_id, sequence_id) [pk]
136+
}
137+
}

0 commit comments

Comments
 (0)