INNER CODE UNIT · Python

ensure_version_table

litestar-org/advanced-alchemy · advanced_alchemy/cli.py:288

    def ensure_version_table(bind_key: Optional[str], sql: bool) -> None:  # pyright: ignore[reportUnusedFunction]
        """Ensure alembic version table exists."""
        from advanced_alchemy.alembic.commands import AlembicCommands

        ctx = cast("click.Context", click.get_current_context())
        console.rule("[yellow]Ensuring version table exists[/]", align="left")
        sqlalchemy_config = get_config_by_bind_key(ctx, bind_key)
        alembic_commands = AlembicCommands(sqlalchemy_config=sqlalchemy_config)
        alembic_commands.ensure_version(sql=sql)

    @database_group.command(
        name="heads",
        help="Show current available heads in the script directory",
    )
    @bind_key_option
    @verbose_option
    @click.option(
        "--resolve-dependencies",

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…