def run_migrations_online():
    engine = current_app.extensions['sqlalchemy'].db.engine

    connection = engine.connect()
    context.configure(connection=connection, target_metadata=target_metadata)

    try:
        with context.begin_transaction():
            context.run_migrations()
    finally:
        connection.close()
Run migrations in 'online' mode.
dataset/ETHPy150Open aromanovich/kozmic-ci/migrations/env.py/run_migrations_online