-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdb-init.sql
More file actions
37 lines (34 loc) · 991 Bytes
/
Copy pathdb-init.sql
File metadata and controls
37 lines (34 loc) · 991 Bytes
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
# Инициализация базы данных помещений
create table if not exists rooms (
id uuid primary key,
rtsp text,
title text
)
# Инициализация базы данных статистики
create table if not exists statistics (
id uuid primary key,
work_stations integer,
persons integer,
sitting_persons integer,
not_sitting_persons integer,
free_work_station integer,
timestamp timestamp,
room_id uuid,
FOREIGN KEY (room_id) REFERENCES rooms (id)
)
# Инициализация базы данных рабочих мест
create table if not exists work_stations (
id uuid primary key,
x_center real,
y_center real,
width real,
height real,
room_id uuid,
)
# Инициализация базы данных статистики рабочих мест
create table if not exists work_stations_statistics (
id uuid primary key,
work_station_id uuid,
free boolean,
timestamp timestamp,
)