From b0652add433729ec930dc7152b0e5d84216e7a40 Mon Sep 17 00:00:00 2001 From: Brain Date: Fri, 13 Sep 2024 15:25:04 +0200 Subject: [PATCH] Replaced deprecated method see https://flask-sqlalchemy.palletsprojects.com/en/3.1.x/api/#flask_sqlalchemy.SQLAlchemy.get_engine --- migrations/env.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/migrations/env.py b/migrations/env.py index 67e5d0f..c4c0190 100644 --- a/migrations/env.py +++ b/migrations/env.py @@ -19,7 +19,7 @@ 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( + str(current_app.extensions['migrate'].db.engine.url).replace( '%', '%%')) target_metadata = current_app.extensions['migrate'].db.metadata @@ -68,7 +68,7 @@ def run_migrations_online(): directives[:] = [] logger.info('No changes in schema detected.') - connectable = current_app.extensions['migrate'].db.get_engine() + connectable = current_app.extensions['migrate'].db.engine with connectable.connect() as connection: context.configure(