"""Add original_filename to ocr_job_metrics.

Revision ID: add_original_filename_to_metrics
Revises: add_ocr_settings_metrics
Create Date: 2025-12-31

Adds original_filename column to track the uploaded filename.
"""
from alembic import op
import sqlalchemy as sa


# Revision identifiers
revision = 'add_original_filename_to_metrics'
down_revision = 'add_ocr_settings_metrics'
branch_labels = None
depends_on = None


def upgrade() -> None:
    """Add original_filename column to ocr_job_metrics."""
    op.add_column(
        'ocr_job_metrics',
        sa.Column('original_filename', sa.String(length=255), nullable=True)
    )


def downgrade() -> None:
    """Remove original_filename column."""
    op.drop_column('ocr_job_metrics', 'original_filename')
