diff --git a/src/production/configurations/grafana/dashboards/postgres.json b/src/production/configurations/grafana/dashboards/postgres.json index 5917ac38..8e6f4601 100644 --- a/src/production/configurations/grafana/dashboards/postgres.json +++ b/src/production/configurations/grafana/dashboards/postgres.json @@ -213,7 +213,7 @@ "editorMode": "code", "format": "table", "rawQuery": true, - "rawSql": "SELECT created as time, row_number() OVER (ORDER BY created) FROM maevsi_private.account", + "rawSql": "SELECT created_at as time, row_number() OVER (ORDER BY created_at) FROM maevsi_private.account", "refId": "A", "sql": { "columns": [ diff --git a/src/production/configurations/grafana/provisioning/datasources/postgres.yaml b/src/production/configurations/grafana/provisioning/datasources/postgres.yaml index d4ef785c..e9aea103 100644 --- a/src/production/configurations/grafana/provisioning/datasources/postgres.yaml +++ b/src/production/configurations/grafana/provisioning/datasources/postgres.yaml @@ -8,7 +8,7 @@ datasources: sslmode: 'disable' name: PostgreSQL secureJsonData: - password: postgres + password: $__file{/run/secrets/postgres_role_grafana_password} type: grafana-postgresql-datasource url: postgres:5432 - user: postgres + user: $__file{/run/secrets/postgres_role_grafana_username} diff --git a/src/production/configurations/postgres/docker-entrypoint-initdb.d/additional-databases.sh b/src/production/configurations/postgres/docker-entrypoint-initdb.d/additional-databases.sh index c4dbf646..2f77c3a1 100755 --- a/src/production/configurations/postgres/docker-entrypoint-initdb.d/additional-databases.sh +++ b/src/production/configurations/postgres/docker-entrypoint-initdb.d/additional-databases.sh @@ -2,7 +2,7 @@ set -eu -username="$(cat /run/secrets/postgres_user)" +postgres_user="$(cat /run/secrets/postgres_user)" create_database_and_role() { db_name="$1" @@ -24,7 +24,7 @@ create_database_and_role() { echo "[INFO] Creating user and database: '$db_name'" - psql -v ON_ERROR_STOP=1 --username "$username" --dbname "postgres" <<-EOSQL + psql -v ON_ERROR_STOP=1 --username "$postgres_user" --dbname "postgres" <<-EOSQL CREATE ROLE "$db_username" WITH LOGIN PASSWORD '$db_password'; CREATE DATABASE "$db_name" OWNER "$db_username"; EOSQL