"""Add status to servers.

Revision ID: 1c6edbdb4642
Revises: 49e1ab420276
Create Date: 2025-04-22 08:54:20.892397

"""

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = "1c6edbdb4642"
down_revision = "49e1ab420276"
branch_labels = None
depends_on = None


def upgrade():
    op.add_column(
        "server",
        sa.Column(
            "status",
            sa.String(),
            nullable=True,
        ),
    )
    op.execute("""UPDATE server SET status = 'active'""")
    op.alter_column("server", "status", nullable=False)


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