"""Add status to workflow table

Revision ID: 26dc22efaf0b
Revises: 3a37869686bd
Create Date: 2025-01-24 20:03:14.509740+00:00

"""

from typing import Sequence, Union

import sqlalchemy as sa

from alembic import op

# revision identifiers, used by Alembic.
revision: str = "26dc22efaf0b"
down_revision: Union[str, None] = "3a37869686bd"
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column("workflows", sa.Column("status", sa.String(), nullable=True))
    op.execute("UPDATE workflows SET status = 'published'")
    op.alter_column("workflows", "status", nullable=False)
    # ### end Alembic commands ###


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