Create an alembic migration context.

def create_migration_ctx(**kwargs):
    """Create an alembic migration context."""
    env = EnvironmentContext(Config(), None)
    env.configure(
        connection=db.engine.connect(),
        sqlalchemy_module_prefix='db.',
        **kwargs
    )
    return env.get_context()