"""005_product_image_path — products 表加 image_path 列（产品参考图本地路径）
前端图片上传完成后，BE 接口写入此字段；pipeline_io 读取用于生图参考。
"""
from alembic import op
import sqlalchemy as sa


revision = "005"
down_revision = "004"
branch_labels = None
depends_on = None


def upgrade() -> None:
    op.add_column(
        "products",
        sa.Column(
            "image_path",
            sa.String(512),
            nullable=True,
            comment="产品参考图本地文件路径（前端上传后写入，生图时作 reference_images 注入）",
        ),
    )


def downgrade() -> None:
    op.drop_column("products", "image_path")
