"""add certificate import batch id

Revision ID: 20260623_0005
Revises: 20260623_0004
Create Date: 2026-06-23
"""

from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa

revision: str = "20260623_0005"
down_revision: Union[str, None] = "20260623_0004"
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
    op.add_column("certificates", sa.Column("import_batch_id", sa.Integer(), nullable=True))
    op.create_index("ix_certificates_import_batch_id", "certificates", ["import_batch_id"])


def downgrade() -> None:
    op.drop_index("ix_certificates_import_batch_id", table_name="certificates")
    op.drop_column("certificates", "import_batch_id")
