"""create award eligibility snapshots table

Revision ID: 72e643ad5b8c
Revises: c4944a5dd4a0
Create Date: 2026-03-12 20:21:09.037178

"""

import sqlalchemy as sa
from alembic import op

# revision identifiers, used by Alembic.
revision = "72e643ad5b8c"
down_revision = "c4944a5dd4a0"
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table(
        "award_eligibility_snapshots",
        sa.Column("medal_id", sa.Integer(), nullable=False),
        sa.Column("year", sa.Integer(), nullable=False),
        sa.Column("rodne_cislo", sa.String(length=10), nullable=False),
        sa.Column("created_at", sa.DateTime(), nullable=False),
        sa.ForeignKeyConstraint(
            ["medal_id"],
            ["medals.id"],
        ),
        sa.PrimaryKeyConstraint("medal_id", "year", "rodne_cislo"),
    )
    # ### end Alembic commands ###


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