"""add outcome fields to sessions

Revision ID: 029
Revises: 028
Create Date: 2026-02-11

Adds outcome and outcome_notes columns for session completion tracking.
"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision: str = "029"
down_revision: Union[str, None] = "028"
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
    op.add_column("sessions", sa.Column("outcome", sa.String(length=20), nullable=True))
    op.add_column("sessions", sa.Column("outcome_notes", sa.Text(), nullable=True))
    op.create_index(op.f("ix_sessions_outcome"), "sessions", ["outcome"], unique=False)


def downgrade() -> None:
    op.drop_index(op.f("ix_sessions_outcome"), table_name="sessions")
    op.drop_column("sessions", "outcome_notes")
    op.drop_column("sessions", "outcome")
