"""add tunnel fields to tool_instances

Revision ID: 0011_tool_instance_tunnel_fields
Revises: 0010_tool_type_default_port
Create Date: 2026-05-20 12:00:00.000000

"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa

# revision identifiers, used by Alembic.
revision: str = "0011_tool_instance_tunnel_fields"
down_revision: Union[str, None] = "0010_tool_type_default_port"
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
    op.add_column(
        "tool_instances",
        sa.Column("public_url", sa.String(1024), nullable=True)
    )
    op.add_column(
        "tool_instances",
        sa.Column("tunnel_id", sa.String(255), nullable=True)
    )


def downgrade() -> None:
    op.drop_column("tool_instances", "tunnel_id")
    op.drop_column("tool_instances", "public_url")
