"""Add LLM metrics information to business events

Revision ID: 16f70b210557
Revises: 829094f07d44
Create Date: 2024-10-01 09:46:49.372953

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '16f70b210557'
down_revision = '829094f07d44'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table('business_event_log', schema=None) as batch_op:
        batch_op.add_column(sa.Column('llm_metrics_total_tokens', sa.Integer(), nullable=True))
        batch_op.add_column(sa.Column('llm_metrics_prompt_tokens', sa.Integer(), nullable=True))
        batch_op.add_column(sa.Column('llm_metrics_completion_tokens', sa.Integer(), nullable=True))
        batch_op.add_column(sa.Column('llm_metrics_total_time', sa.Float(), nullable=True))
        batch_op.add_column(sa.Column('llm_metrics_call_count', sa.Integer(), nullable=True))

    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table('business_event_log', schema=None) as batch_op:
        batch_op.drop_column('llm_metrics_call_count')
        batch_op.drop_column('llm_metrics_total_time')
        batch_op.drop_column('llm_metrics_completion_tokens')
        batch_op.drop_column('llm_metrics_prompt_tokens')
        batch_op.drop_column('llm_metrics_total_tokens')

    # ### end Alembic commands ###
