"""

Revision ID: 55553b8098f9
Revises: c06dc04e782b
Create Date: 2025-11-19 20:51:32.350934

"""

from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import sqlite

# revision identifiers, used by Alembic.
revision: str = "55553b8098f9"
down_revision: Union[str, None] = "c06dc04e782b"
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! ###

    with op.batch_alter_table("analysis", schema=None) as batch_op:
        batch_op.add_column(sa.Column("occurrences", sa.Integer(), nullable=True))
        batch_op.add_column(sa.Column("total_value", sa.Float(), nullable=True))
        batch_op.add_column(sa.Column("total_increase", sa.Float(), nullable=True))
        batch_op.create_index("ix_analysis_occurrences", ["occurrences"], unique=False)
        batch_op.create_index(
            "ix_analysis_total_increase", ["total_increase"], unique=False
        )
        batch_op.create_index("ix_analysis_total_value", ["total_value"], unique=False)

    # ### end Alembic commands ###


def downgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table("analysis", schema=None) as batch_op:
        batch_op.drop_index("ix_analysis_total_value")
        batch_op.drop_index("ix_analysis_total_increase")
        batch_op.drop_index("ix_analysis_occurrences")
        batch_op.drop_column("total_increase")
        batch_op.drop_column("total_value")
        batch_op.drop_column("occurrences")
