add view for measurement

This commit is contained in:
2023-05-23 16:06:57 +02:00
parent 12b204d206
commit 68f98d7668

View File

@ -61,3 +61,20 @@ grant select on variable_t to preprocessor;
grant insert on measurement_t to preprocessor;
grant select on measurement_t to grafana;
create view measurement_v as
select m.time as time,
m.value as value,
v.quantity as quantity,
v.unit as unit,
v.label as variable,
a.label as application
from measurement_t m,
application_t a,
variable_t v
where m.variable = v.id and
v.app = a.id;
grant select on measurement_v to grafana;