Skip to content
Discussion options

You must be logged in to vote

Hi,

You will need to modify your code to conditionally use asyncio.run or the existing loop to run the run_async_migrations coroutine.
something like this could work

def run_migrations_online() -> None:
    """Run migrations in 'online' mode."""

    try:
      asyncio.get_running_loop().run_until_complete(run_async_migrations())
      return
    except RuntimeError:
      pass
    asyncio.run(run_async_migrations())

Replies: 2 comments 8 replies

Comment options

You must be logged in to vote
8 replies
@zzzeek
Comment options

@EricScottN
Comment options

@zzzeek
Comment options

@zzzeek
Comment options

@fkarg
Comment options

Answer selected by EricScottN
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4 participants
Converted from issue

This discussion was converted from issue #1514 on August 05, 2024 19:52.