"""Add transport-protocol column to servers

Revision ID: c98f44cea12f
Revises: f2298e6acd39
Create Date: 2025-05-31 11:56:05.469429

"""

from alembic import op
import sqlalchemy as sa

# revision identifiers, used by Alembic.
revision = "c98f44cea12f"
down_revision = "4b5c0d56e1ca"
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column("server", sa.Column("transport_protocol", sa.String(), nullable=True))
    op.execute("""UPDATE server SET transport_protocol = 'SSE' WHERE status = 'active'""")
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column("server", "transport_protocol")
    # ### end Alembic commands ###
