diff options
author | Dennis Eriksen <d@ennis.no> | 2023-01-30 20:05:25 +0100 |
---|---|---|
committer | Dennis Eriksen <d@ennis.no> | 2023-01-30 20:05:25 +0100 |
commit | 577f3b123b319414b4fa50ff9d2838015ccb372e (patch) | |
tree | ffccfa8ce30f1e1876e66adec6fe67276c3d1ad9 /schema.sql | |
parent | adding a few dependencies (diff) | |
download | energyscripts-577f3b123b319414b4fa50ff9d2838015ccb372e.tar.gz |
adding handler for tempsensors on mqtt
Diffstat (limited to 'schema.sql')
-rw-r--r-- | schema.sql | 51 |
1 files changed, 51 insertions, 0 deletions
@@ -66,6 +66,42 @@ CREATE TABLE public.entsoe ( -- +-- Name: mqtt_temps; Type: TABLE; Schema: public; Owner: - +-- + +CREATE TABLE public.mqtt_temps ( + id integer NOT NULL, + name text NOT NULL, + temperature real, + humidity real, + battery smallint, + linkquality smallint, + voltage integer, + "time" timestamp with time zone DEFAULT now() NOT NULL +); + + +-- +-- Name: mqtt_temps_id_seq; Type: SEQUENCE; Schema: public; Owner: - +-- + +CREATE SEQUENCE public.mqtt_temps_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +-- +-- Name: mqtt_temps_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - +-- + +ALTER SEQUENCE public.mqtt_temps_id_seq OWNED BY public.mqtt_temps.id; + + +-- -- Name: nbex; Type: TABLE; Schema: public; Owner: - -- @@ -164,6 +200,13 @@ CREATE TABLE public.yr ( -- +-- Name: mqtt_temps id; Type: DEFAULT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.mqtt_temps ALTER COLUMN id SET DEFAULT nextval('public.mqtt_temps_id_seq'::regclass); + + +-- -- Name: neohub id; Type: DEFAULT; Schema: public; Owner: - -- @@ -195,6 +238,14 @@ ALTER TABLE ONLY public.entsoe -- +-- Name: mqtt_temps mqtt_temps_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.mqtt_temps + ADD CONSTRAINT mqtt_temps_pkey PRIMARY KEY (id); + + +-- -- Name: nbex nbexchange_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- |