aboutsummaryrefslogtreecommitdiffstats
path: root/schema.sql
diff options
context:
space:
mode:
authorDennis Eriksen <d@ennis.no>2023-01-30 20:05:25 +0100
committerDennis Eriksen <d@ennis.no>2023-01-30 20:05:25 +0100
commit577f3b123b319414b4fa50ff9d2838015ccb372e (patch)
treeffccfa8ce30f1e1876e66adec6fe67276c3d1ad9 /schema.sql
parentadding a few dependencies (diff)
downloadenergyscripts-577f3b123b319414b4fa50ff9d2838015ccb372e.tar.gz
adding handler for tempsensors on mqtt
Diffstat (limited to 'schema.sql')
-rw-r--r--schema.sql51
1 files changed, 51 insertions, 0 deletions
diff --git a/schema.sql b/schema.sql
index 84301dd..9fbb3a2 100644
--- a/schema.sql
+++ b/schema.sql
@@ -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: -
--