-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdatahub_er_model.puml
105 lines (95 loc) · 2.35 KB
/
datahub_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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
@startuml
entity "Device" as Device {
+ id : String [PK]
+ device_name : String
+ model : String
+ firmware : String
+ btmac_address : String
+ last_update : DateTime
+ notes : Text
}
entity "Measurement" as Measurement {
+ id : Integer [PK]
+ time_received : DateTime
+ time_measured : DateTime
+ sensor_model : Integer
--
+ device_id : String [FK]
+ room_id : Integer [FK]
}
entity "Values" as Values {
+ id : Integer [PK]
+ dimension : Integer
+ value : Float
--
+ measurement_id : Integer [FK]
}
entity "DeviceLogs" as DeviceLogs {
+ id : Integer [PK]
+ device_id : String [FK]
+ timestamp : DateTime
+ level : Integer
+ message : String
--
+ device_id : String [FK]
}
entity "Room" as Room {
+ campaign_id : Integer [PK, FK]
+ name : String [PK]
--
+ campaign_id : Integer [FK]
}
entity "Campaign" as Campaign {
+ id : Integer [PK]
+ name : String
+ description : Text
+ start_date : DateTime
+ end_date : DateTime
+ public : Boolean
+ id_token : String [unique]
+ owner_id : Integer [FK]
--
+ owner_id : Integer [FK]
}
entity "DeviceStatus" as DeviceStatus {
+ id : Integer [PK]
+ time_received : DateTime
+ battery_voltage : Float
+ battery_soc : Float
+ sensors : JSON
--
+ device_id : String [FK]
}
entity "Organization" as Organization {
+ id : Integer [PK]
+ name : String
+ description : Text
--
+ owner_id : Integer [FK]
}
entity "UserOrganization" as UserOrganization {
+ id : Integer [PK]
--
+ user_id : Integer [FK]
+ organization_id : Integer [FK]
}
entity "UserCampaign" as UserCampaign {
+ id : Integer [PK]
--
+ user_id : Integer [FK]
+ campaign_id : Integer [FK]
}
Device ||--o{ Measurement : "records"
Room ||--o{ Device : "is in"
Organization ||--o{ Device : "is in"
Measurement ||--o{ Values : "has"
Device ||--o{ DeviceLogs : "logs"
Device ||--o{ DeviceStatus : "has status"
Measurement ||--o{ Room : "takes place in"
Campaign ||--o{ Room : "contains"
UserOrganization ||--o{ User : "user is part of"
UserOrganization ||--o{ Organization : "organization has users"
UserCampaign ||--o{ User : "user participates in"
UserCampaign ||--o{ Campaign : "campaign has users"
Campaign ||--o{ Organization : "organization has campaigns"
@enduml