atmost working example

This commit is contained in:
Aleksandr Trushkin
2024-08-11 21:44:19 +03:00
parent 0046755c7d
commit 880f67aa73
16 changed files with 566 additions and 107 deletions

12
assets/db/schema.sql Normal file
View File

@ -0,0 +1,12 @@
CREATE TABLE IF NOT EXISTS public.stats (
device_id TEXT NOT NULL,
inc_traffic INT NOT NULL DEFAULT 0,
out_traffic INT NOT NULL DEFAULT 0,
inc_rps INT NOT NULL DEFAULT 0,
read_rps INT NOT NULL DEFAULT 0,
write_rps INT NOT NULL DEFAULT 0,
updated_at TIMESTAMP WITHOUT TIME ZONE DEFAULT NOW()
);
CREATE UNIQUE INDEX IF NOT EXISTS
stats_by_device_id_idx ON public.stats(device_id);