"""add batch_id and target_label to sessions

Revision ID: 6e8128ef2aa8
Revises: 5812e7df852f
Create Date: 2026-02-17

"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql

# revision identifiers, used by Alembic.
revision = '6e8128ef2aa8'
down_revision = '5812e7df852f'
branch_labels = None
depends_on = None


def upgrade() -> None:
    op.add_column('sessions', sa.Column('batch_id', postgresql.UUID(as_uuid=True), nullable=True))
    op.add_column('sessions', sa.Column('target_label', sa.String(255), nullable=True))
    op.create_index('ix_sessions_batch_id', 'sessions', ['batch_id'])


def downgrade() -> None:
    op.drop_index('ix_sessions_batch_id', table_name='sessions')
    op.drop_column('sessions', 'target_label')
    op.drop_column('sessions', 'batch_id')
