From 20cfd54cd75ae72a90afcaa35495877fe80e55a1 Mon Sep 17 00:00:00 2001 From: Bogdan Crisan Date: Wed, 3 Jul 2024 14:35:43 +0200 Subject: [PATCH] add grafana role during built-in migrations --- cfg/cspell-dictionary.txt | 1 + sql_extensions/sql/00002_add_grafana_role.sql | 5 +++++ 2 files changed, 6 insertions(+) create mode 100644 sql_extensions/sql/00002_add_grafana_role.sql diff --git a/cfg/cspell-dictionary.txt b/cfg/cspell-dictionary.txt index 0b141db..4bb90ad 100644 --- a/cfg/cspell-dictionary.txt +++ b/cfg/cspell-dictionary.txt @@ -36,6 +36,7 @@ mdformat mosquitto mqtt mqttoptions +noqa notif pgrep plpgsql diff --git a/sql_extensions/sql/00002_add_grafana_role.sql b/sql_extensions/sql/00002_add_grafana_role.sql new file mode 100644 index 0000000..2979aaa --- /dev/null +++ b/sql_extensions/sql/00002_add_grafana_role.sql @@ -0,0 +1,5 @@ +-- noqa: disable=PRS +CREATE ROLE grafana ENCRYPTED PASSWORD 'grafana' LOGIN; + +GRANT SELECT ON ALL TABLES IN SCHEMA public TO grafana; +ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO grafana;