From 68f98d766857eabb770789cdc290ec96736b9314 Mon Sep 17 00:00:00 2001 From: Wolfgang Hottgenroth Date: Tue, 23 May 2023 16:06:57 +0200 Subject: [PATCH] add view for measurement --- schema/create-schema.sql | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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; + +