diff --git a/schema/create-schema.sql b/schema/create-schema.sql index e847575..0b7dd64 100644 --- a/schema/create-schema.sql +++ b/schema/create-schema.sql @@ -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; + +