"""ee7739b

Revision ID: bebaddef3e8d
Revises: 474b572b7fe2
Create Date: 2026-01-17 13:16:39.809170

"""

from collections.abc import Sequence

import sqlalchemy as sa
from alembic import op

# revision identifiers, used by Alembic.
revision: str = "bebaddef3e8d"
down_revision: str | None = "474b572b7fe2"
branch_labels: str | Sequence[str] | None = None
depends_on: str | Sequence[str] | None = None


def upgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table(
        "recognizer_results",
        sa.Column("id", sa.String(), nullable=False),
        sa.Column("attachment_id", sa.String(), nullable=False),
        sa.Column("user_id", sa.String(), nullable=False),
        sa.Column("device_id", sa.String(), nullable=False),
        sa.Column("created_at", sa.DateTime(timezone=True), nullable=False),
        sa.ForeignKeyConstraint(["attachment_id"], ["attachments.id"], name="votes_attachment_id_fk"),
        sa.PrimaryKeyConstraint("id"),
    )
    op.create_table(
        "recognizer_results_beerds",
        sa.Column("id", sa.String(), nullable=False),
        sa.Column("recognizer_results_id", sa.String(), nullable=False),
        sa.Column("beerd_id", sa.String(), nullable=False),
        sa.ForeignKeyConstraint(["beerd_id"], ["beerds.id"], name="recognizer_results_beerd_id_fk"),
        sa.ForeignKeyConstraint(["recognizer_results_id"], ["recognizer_results.id"], name="recognizer_results_id_fk"),
        sa.PrimaryKeyConstraint("id"),
    )
    # ### end Alembic commands ###


def downgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table("recognizer_results_beerds")
    op.drop_table("recognizer_results")
    # ### end Alembic commands ###
