d2495190a9
AI now returns a short descriptive title per document (e.g. "ACME Corp
Invoice April 2026"). Title is stored in a new documents.title column
(migration 0002), shown in the row header instead of the raw filename,
and editable inline via PATCH /documents/{id}/title. Filename is shown
as a subtitle when a title exists.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
25 lines
519 B
Python
25 lines
519 B
Python
"""add document title column
|
|
|
|
Revision ID: 0002
|
|
Revises: 0001
|
|
Create Date: 2026-04-14
|
|
|
|
"""
|
|
from typing import Sequence, Union
|
|
|
|
import sqlalchemy as sa
|
|
from alembic import op
|
|
|
|
revision: str = "0002"
|
|
down_revision: Union[str, None] = "0001"
|
|
branch_labels: Union[str, Sequence[str], None] = None
|
|
depends_on: Union[str, Sequence[str], None] = None
|
|
|
|
|
|
def upgrade() -> None:
|
|
op.add_column("documents", sa.Column("title", sa.String(500), nullable=True))
|
|
|
|
|
|
def downgrade() -> None:
|
|
op.drop_column("documents", "title")
|