add schema

This commit is contained in:
Wolfgang Hottgenroth 2023-02-06 17:36:35 +01:00
parent b74c5c7fc7
commit ae8905e43c
Signed by: wn
GPG Key ID: 836E9E1192A6B132

25
schema Normal file
View File

@ -0,0 +1,25 @@
create table pv_power_measurement_t (
time timestamp without time zone not null,
deviceid text,
status text,
state integer,
importEnergyActive double precision,
importEnergyReactive double precision,
exportEnergyActive double precision,
exportEnergyReactive double precision,
powerApparent double precision,
powerActive double precision,
powerReactive double precision,
powerDemandPositive double precision,
powerDemandReverse double precision,
powerDemand double precision,
factor double precision,
angle double precision,
voltage double precision,
current double precision
);
select create_hypertable('pv_power_measurement_t', 'time');
grant insert on pv_power_measurement_t to nodered;
grant select on pv_power_measurement_t to grafana;