"""Add conclusion fields to assistant_chats.

Revision ID: 048
Revises: 047
Create Date: 2026-03-05
"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa

revision: str = "048"
down_revision: str = "047"
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
    op.add_column(
        "assistant_chats",
        sa.Column("conclusion_outcome", sa.String(20), nullable=True),
    )
    op.add_column(
        "assistant_chats",
        sa.Column("conclusion_summary", sa.String, nullable=True),
    )
    op.add_column(
        "assistant_chats",
        sa.Column("concluded_at", sa.DateTime(timezone=True), nullable=True),
    )


def downgrade() -> None:
    op.drop_column("assistant_chats", "concluded_at")
    op.drop_column("assistant_chats", "conclusion_summary")
    op.drop_column("assistant_chats", "conclusion_outcome")
