Brain 2024-09-13 15:25:04 +02:00
parent 60c906cb5c
commit b0652add43
Signed by: Brain
GPG Key ID: EE936E31EE3AEE7A

View File

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