"""add wokrer.status column

Revision ID: 0dd436073e84
Revises: a06b7ba8f4bd
Create Date: 2024-10-31 18:05:27.511948

"""

import sqlalchemy as sa
from alembic import op

# revision identifiers, used by Alembic.
revision = "0dd436073e84"
down_revision = "a06b7ba8f4bd"
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column(
        "workers",
        sa.Column("status", sa.VARCHAR(64), default="ALIVE", server_default="ALIVE", nullable=True),
    )
    op.execute("UPDATE workers SET status = 'ALIVE'")
    op.alter_column("workers", "status", nullable=False)

    # ### end Alembic commands ###


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