"""add category and interfaces to tool_types

Revision ID: 0008_tool_type_category
Revises: 0007_instance_container_name
Create Date: 2026-05-20 09:00:00.000000

"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa

# revision identifiers, used by Alembic.
revision: str = "0008_tool_type_category"
down_revision: Union[str, None] = "0007_instance_container_name"
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
    op.add_column(
        "tool_types",
        sa.Column("category", sa.String(50), nullable=False, server_default="other")
    )
    op.add_column(
        "tool_types",
        sa.Column("interfaces", sa.JSON(), nullable=False, server_default='["web"]')
    )


def downgrade() -> None:
    op.drop_column("tool_types", "interfaces")
    op.drop_column("tool_types", "category")
