"""keep track of reasoning token and cached token in the step and thought tables

Revision ID: 3aa168d1ffa5
Revises: c6c0eee7f88d
Create Date: 2025-03-20 23:24:39.160800+00:00

"""

from typing import Sequence, Union

import sqlalchemy as sa

from alembic import op

# revision identifiers, used by Alembic.
revision: str = "3aa168d1ffa5"
down_revision: Union[str, None] = "c6c0eee7f88d"
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("observer_thoughts", sa.Column("reasoning_token_count", sa.Integer(), nullable=True))
    op.add_column("observer_thoughts", sa.Column("cached_token_count", sa.Integer(), nullable=True))
    op.add_column("steps", sa.Column("reasoning_token_count", sa.Integer(), nullable=True))
    op.add_column("steps", sa.Column("cached_token_count", sa.Integer(), nullable=True))
    # ### end Alembic commands ###


def downgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column("steps", "cached_token_count")
    op.drop_column("steps", "reasoning_token_count")
    op.drop_column("observer_thoughts", "cached_token_count")
    op.drop_column("observer_thoughts", "reasoning_token_count")
    # ### end Alembic commands ###
