"""add analysis_status to ai_sessions

Revision ID: a0b871cb0c5e
Revises: 47c3b4f42e88
Create Date: 2026-03-19 03:26:26.965134

"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa

# revision identifiers, used by Alembic.
revision: str = 'a0b871cb0c5e'
down_revision: Union[str, None] = '47c3b4f42e88'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
    op.add_column('ai_sessions', sa.Column(
        'analysis_status', sa.String(length=20), nullable=True,
        comment='Knowledge Flywheel status: null (N/A), pending, completed, failed',
    ))


def downgrade() -> None:
    op.drop_column('ai_sessions', 'analysis_status')
