"""Add score field to IndexerQueryResult table

Revision ID: 5299dfed220b
Revises: 1801d9f5a275
Create Date: 2025-07-16 23:24:37.931188

"""

from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision: str = "5299dfed220b"
down_revision: Union[str, None] = "1801d9f5a275"
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
    """Upgrade schema."""
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column(
        "indexer_query_result",
        sa.Column("score", sa.Integer(), nullable=False, server_default=sa.text("0")),
    )
    # ### end Alembic commands ###


def downgrade() -> None:
    """Downgrade schema."""
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column("indexer_query_result", "score")
    # ### end Alembic commands ###
