"""Add metadata column to doc table

Revision ID: 898918bedceb
Revises: f22991f23e5b
Create Date: 2025-09-20 12:01:56.854686

"""

from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision: str = "898918bedceb"
down_revision: Union[str, Sequence[str], None] = "f22991f23e5b"
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
    """Upgrade schema."""
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column("documents", sa.Column("metadata", sa.JSON(), nullable=True))
    # ### end Alembic commands ###


def downgrade() -> None:
    """Downgrade schema."""
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column("documents", "metadata", if_exists=True)
    # ### end Alembic commands ###
