eea99eb01d
- Add ENABLE_PDFA_CONVERSION, PDFA_FORMAT, PDFA_UPLOAD_TO_PROVIDERS config settings - Add original_pdfa_path and processed_pdfa_path columns to FileRecord model - Create Alembic migration 011_add_pdfa_paths - Create app/tasks/convert_to_pdfa.py Celery task using ocrmypdf + Ghostscript - Integrate PDF/A conversion into finalize_document_storage pipeline - Add comprehensive unit tests (15 tests) - Update .env.demo and docs/ConfigurationGuide.md Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
30 lines
853 B
Python
30 lines
853 B
Python
"""Add PDF/A archival variant path columns to files table
|
|
|
|
Revision ID: 011_add_pdfa_paths
|
|
Revises: 010_add_embedding_column
|
|
Create Date: 2026-03-02
|
|
|
|
"""
|
|
|
|
from typing import Union
|
|
|
|
import sqlalchemy as sa
|
|
from alembic import op
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision: str = "011_add_pdfa_paths"
|
|
down_revision: Union[str, None] = "010_add_embedding_column"
|
|
depends_on: Union[str, None] = None
|
|
|
|
|
|
def upgrade() -> None:
|
|
"""Add PDF/A variant path columns to files table."""
|
|
op.add_column("files", sa.Column("original_pdfa_path", sa.String(), nullable=True))
|
|
op.add_column("files", sa.Column("processed_pdfa_path", sa.String(), nullable=True))
|
|
|
|
|
|
def downgrade() -> None:
|
|
"""Remove PDF/A variant path columns from files table."""
|
|
op.drop_column("files", "processed_pdfa_path")
|
|
op.drop_column("files", "original_pdfa_path")
|