support db migrations
This commit is contained in:
13
assets/db/migrations/0001_init.up.sql
Normal file
13
assets/db/migrations/0001_init.up.sql
Normal file
@ -0,0 +1,13 @@
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user