From 9d7927067d287c3752ba69236d156b4215ca8881 Mon Sep 17 00:00:00 2001 From: mershad-manesh <105240903+mershad-manesh@users.noreply.github.com> Date: Tue, 14 Nov 2023 12:54:12 -0500 Subject: [PATCH] Ensure the database is owned by user (#43) --- horizon/scripts/grafana-init.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/horizon/scripts/grafana-init.sh b/horizon/scripts/grafana-init.sh index 9170f88..585977e 100644 --- a/horizon/scripts/grafana-init.sh +++ b/horizon/scripts/grafana-init.sh @@ -46,4 +46,6 @@ else psql -c "alter role ${GF_DATABASE_USER} with password '${GF_DATABASE_PASSWORD}';" psql -c "alter user ${GF_DATABASE_USER} set search_path to ${GF_DATABASE_NAME},public;" psql -c "grant all on database ${GF_DATABASE_NAME} to ${GF_DATABASE_USER};" + psql -c "ALTER DATABASE ${GF_DATABASE_NAME} OWNER TO ${GF_DATABASE_USER};" + psql -c "GRANT USAGE, CREATE ON SCHEMA PUBLIC TO ${GF_DATABASE_USER};" fi