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)
);