-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapi_er_model.puml
81 lines (73 loc) · 1.75 KB
/
api_er_model.puml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
@startuml
entity "Country" as Country {
+ id : Integer [PK]
+ name : String [unique, index]
+ slug : String [unique, index]
+ code : String [unique, index]
}
entity "City" as City {
+ id : Integer [PK]
+ name : String [index]
+ slug : String [unique, index]
+ tz : String
+ lat : Float
+ lon : Float
--
+ country_id : Integer [FK]
}
entity "Location" as Location {
+ id : Integer [PK]
+ lat : Float
+ lon : Float
+ height : Float
--
+ city_id : Integer [FK]
+ country_id : Integer [FK]
}
entity "Station" as Station {
+ id : Integer [PK]
+ device : String [unique, index]
+ firmware : String
+ apikey : String
+ last_active : DateTime
+ source : Integer
--
+ location_id : Integer [FK]
}
entity "Measurement" as Measurement {
+ id : Integer [PK]
+ time_received : DateTime
+ time_measured : DateTime
+ sensor_model : Integer
--
+ location_id : Integer [FK]
+ station_id : Integer [FK]
}
entity "Values" as Values {
+ id : Integer [PK]
+ dimension : Integer
+ value : Float
--
+ measurement_id : Integer [FK]
}
entity "StationStatus" as StationStatus {
+ id : Integer [PK]
+ station_id : Integer [FK]
+ timestamp : DateTime
+ level : Integer
+ message : String
}
entity "HourlyDimensionAverages" as HourlyDimensionAverages {
+ station_id : Integer [PK, FK]
+ hour : DateTime [PK]
+ dimension_avg : JSON
}
Country ||--o{ City : "has"
City ||--o{ Location : "has"
Country ||--o{ Location : "has"
Location ||--o{ Station : "has"
Station ||--o{ Measurement : "records"
Measurement ||--o{ Values : "has"
Station ||--o{ StationStatus : "tracks"
Station ||--o{ HourlyDimensionAverages : "calculates"
@enduml