From 3027534b16a670abf862d06abc2180f4efd05bb9 Mon Sep 17 00:00:00 2001 From: Daniel Seiler Date: Sun, 7 Jan 2024 20:50:46 +0100 Subject: [PATCH] Fix DB connection URL in env.py Previously, this line was returning `***` as the DB password --- migrations/env.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/migrations/env.py b/migrations/env.py index 68feded..c9011d9 100644 --- a/migrations/env.py +++ b/migrations/env.py @@ -22,8 +22,8 @@ logger = logging.getLogger('alembic.env') # target_metadata = mymodel.Base.metadata config.set_main_option( 'sqlalchemy.url', - str(current_app.extensions['migrate'].db.get_engine().url).replace( - '%', '%%')) + current_app.config.get('SQLALCHEMY_DATABASE_URI') +) target_metadata = current_app.extensions['migrate'].db.metadata # other values from the config, defined by the needs of env.py,