do first transformation
This commit is contained in:
18
dbddl/dataraw.sql
Normal file
18
dbddl/dataraw.sql
Normal file
@@ -0,0 +1,18 @@
|
||||
DROP TABLE public.dataraw;
|
||||
|
||||
CREATE TABLE public.dataraw
|
||||
(
|
||||
id serial4 NOT NULL,
|
||||
unit_name text NULL,
|
||||
unit_type text NULL,
|
||||
tool_name text NULL,
|
||||
tool_type text NULL,
|
||||
ip_centralina text NULL,
|
||||
ip_gateway text NULL,
|
||||
event_timestamp timestamp NULL,
|
||||
battery_level float8 NULL,
|
||||
temperature float8 NULL,
|
||||
nodes_jsonb text NULL,
|
||||
CONSTRAINT dataraw_pk PRIMARY KEY (id),
|
||||
CONSTRAINT dataraw_unique UNIQUE (unit_name, tool_name, event_timestamp)
|
||||
);
|
||||
@@ -9,6 +9,7 @@ CREATE TABLE public.received
|
||||
tool_name text NULL,
|
||||
tool_type text NULL,
|
||||
tool_data text NULL,
|
||||
"locked" int2 DEFAULT 0 NULL,
|
||||
status int2 DEFAULT 0 NULL,
|
||||
created_at timestamptz DEFAULT CURRENT_TIMESTAMP NULL,
|
||||
loaded_at timestamptz NULL,
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
DROP TABLE public.virtusers
|
||||
|
||||
CREATE TABLE public.virtusers
|
||||
(
|
||||
id serial4 NOT NULL,
|
||||
|
||||
Reference in New Issue
Block a user