run_migrations_online¶
- safir.database.run_migrations_online(metadata, url, password)¶
Run Alembic migrations online using an async backend.
This function may only be called from the Alembic
env.py
file.- Parameters:
- Return type:
Examples
Normally this is called from
alembic/env.py
with code similar to the following:from alembic import context from safir.database import run_migrations_offline from example.config import config from example.schema import Base if not context.is_offline_mode(): run_migrations_online( Base.metadata, config.database_url, config.database_password )