"""AI PMO 计划包模型。""" from __future__ import annotations from typing import Any, Optional from sqlalchemy import BigInteger, ForeignKey, Integer, Text, VARCHAR from sqlalchemy.orm import Mapped, mapped_column from .base import Base from .types import JSONB class PlanBundle(Base): __tablename__ = "plan_bundles" id: Mapped[int] = mapped_column(Integer, primary_key=True, autoincrement=True) work_item_id: Mapped[int] = mapped_column( BigInteger, ForeignKey("work_items.id", ondelete="CASCADE"), nullable=False, index=True, ) plan_type: Mapped[str] = mapped_column(VARCHAR(20), nullable=False, index=True) summary: Mapped[Optional[str]] = mapped_column(Text, nullable=True) payload: Mapped[Optional[Any]] = mapped_column(JSONB, nullable=True)