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 <pingou@pingoured.fr>
This commit is contained in:
Pierre-Yves Chibon 2019-04-29 13:36:35 +02:00
parent e76e1a88eb
commit f02f70029e

View file

@ -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