From f02f70029e9a18294cf42355745a86b649ce1548 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Mon, 29 Apr 2019 13:36:35 +0200 Subject: [PATCH] elections: use the same url to connect to the DB in alembic as in the application's configuration file Signed-off-by: Pierre-Yves Chibon --- roles/openshift-apps/elections/templates/alembic.ini | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/roles/openshift-apps/elections/templates/alembic.ini b/roles/openshift-apps/elections/templates/alembic.ini index 47c52bf3d9..35fa2b7528 100644 --- a/roles/openshift-apps/elections/templates/alembic.ini +++ b/roles/openshift-apps/elections/templates/alembic.ini @@ -11,7 +11,11 @@ script_location = /opt/app-root/src/alembic # the 'revision' command, regardless of autogenerate # revision_environment = false -sqlalchemy.url = postgresql://{{ elections_db_user }}:{{ elections_db_pass }}@{{ elections_db_host }}/{{ elections_db_name }} +{% if env == 'staging' %} +sqlalchemy.url = postgresql://{{ elections_db_user }}:{{ elections_db_pass }}@db01.stg.phx2.fedoraproject.org/{{ elections_db_name }} +{% else %} +sqlalchemy.url = postgresql://{{ elections_db_user }}:{{ elections_db_pass }}@db01.phx2.fedoraproject.org/elections_db_name }} +{% endif %} # Logging configuration