"""Add nullable description column to grocery_item.

The Lucky California parser produces a long-form description per coupon
(class ``coupon-card-short-description``); without this column it is dropped
silently when persisting. See R2-A spike notes in
``.agent/phase-summaries/r2a-summary.md``.

Revision ID: 0003
Revises: 0002
Create Date: 2026-05-04
"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa


revision: str = '0003'
down_revision: Union[str, None] = '0002'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
    op.add_column(
        "grocery_item",
        sa.Column("description", sa.Text(), nullable=True),
    )


def downgrade() -> None:
    op.drop_column("grocery_item", "description")
