In the newest engine version (2024.2.5), what is the replacement, if any, for
POSTGRAPHILE_DB_PASSWORD
is it:
READ_MODEL_DB_PASSWORD
I’m asking because I can’t find it here - Major upgrades - Noumena Documentation
In the newest engine version (2024.2.5), what is the replacement, if any, for
POSTGRAPHILE_DB_PASSWORD
is it:
READ_MODEL_DB_PASSWORD
I’m asking because I can’t find it here - Major upgrades - Noumena Documentation
There is no replacement, it just got removed. The read_model role is created as part of terraform. in paas we supply the password from the terraform for the db.
resource "postgresql_role" "read-model" {
name = postgresql_database.read-model.name
password = random_password.read-model.result
login = true
create_role = false
}
# the postgraphile db user does not need a CREATE grant on the platform db
resource "postgresql_grant" "postgraphile_platform_database_all" {
database = postgresql_database.platform.name
role = postgresql_role.read-model.name
object_type = "database"
privileges = ["CONNECT", "TEMPORARY"]
}
But what about running locally?
In any case, I think this is missing from the Major Upgrades section in the Docs.
Locally, we have a db script that runs as part of the engine-db container:
volumes:
- ./db_init/db_init.sh:/docker-entrypoint-initdb.d/db_init.sh
which looks like
#!/bin/bash
set -e
set -u
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL
CREATE ROLE $READ_MODEL_DB_USER LOGIN PASSWORD '$POSTGRES_PASSWORD';
GRANT CONNECT ON DATABASE $POSTGRES_DB TO $READ_MODEL_DB_USER;
EOSQL
and for sure, this was figured out the hard way. Would’ve been v useful to be in the docs