"""add delegated_by to agents

Revision ID: a13d97533c44
Revises: 52db06c8cbdd
Create Date: 2026-03-15 09:42:24.828506+00:00

"""
from __future__ import annotations

from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa


revision: str = 'a13d97533c44'
down_revision: Union[str, None] = '52db06c8cbdd'
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('agents', sa.Column('delegated_by', sa.UUID(), nullable=True))
    op.drop_index(op.f('interactions_reported_at_idx'), table_name='interactions')
    # ### end Alembic commands ###


def downgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_index(op.f('interactions_reported_at_idx'), 'interactions', [sa.literal_column('reported_at DESC')], unique=False)
    op.drop_column('agents', 'delegated_by')
    # ### end Alembic commands ###
