Merge pull request #86 from DarkflameUniverse/fix/migrate-env

Fix DB connection URL in env.py
This commit is contained in:
Aaron Kimbrell 2024-01-07 13:57:38 -06:00 committed by GitHub
commit 69823be5c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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