From 577f3b123b319414b4fa50ff9d2838015ccb372e Mon Sep 17 00:00:00 2001
From: Dennis Eriksen <d@ennis.no>
Date: Mon, 30 Jan 2023 20:05:25 +0100
Subject: adding handler for tempsensors on mqtt

---
 schema.sql | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 51 insertions(+)

(limited to 'schema.sql')

diff --git a/schema.sql b/schema.sql
index 84301dd..9fbb3a2 100644
--- a/schema.sql
+++ b/schema.sql
@@ -65,6 +65,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: -
 --
@@ -163,6 +199,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: -
 --
@@ -194,6 +237,14 @@ ALTER TABLE ONLY public.entsoe
     ADD CONSTRAINT entsoe_pkey PRIMARY KEY (starttime, zone);
 
 
+--
+-- 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: -
 --
-- 
cgit v1.2.3

