skill_version.py 1.1 KB

12345678910111213141516171819202122
  1. from datetime import datetime
  2. from sqlalchemy import DateTime, Integer, String
  3. from sqlalchemy.dialects.sqlite import JSON
  4. from sqlalchemy.orm import Mapped, mapped_column
  5. from core_db import AuditMixin, Base, TenantMixin, VersionMixin
  6. from core_shared import JSONValue
  7. class SkillVersion(TenantMixin, AuditMixin, VersionMixin, Base):
  8. __tablename__ = "skill_version"
  9. skill_id: Mapped[str] = mapped_column(String(36), index=True)
  10. version_no: Mapped[int] = mapped_column(Integer)
  11. status: Mapped[str] = mapped_column(String(32), default="draft", index=True)
  12. runtime_type: Mapped[str] = mapped_column(String(32), default="template")
  13. entrypoint: Mapped[str | None] = mapped_column(String(128), nullable=True)
  14. parameter_schema_json: Mapped[dict[str, JSONValue]] = mapped_column(JSON, default=dict)
  15. output_schema_json: Mapped[dict[str, JSONValue]] = mapped_column(JSON, default=dict)
  16. implementation_json: Mapped[dict[str, JSONValue]] = mapped_column(JSON, default=dict)
  17. published_time: Mapped[datetime | None] = mapped_column(DateTime, nullable=True)