skill_installation.py 1004 B

123456789101112131415161718192021
  1. from datetime import datetime
  2. from sqlalchemy import DateTime, 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 SkillInstallation(TenantMixin, AuditMixin, VersionMixin, Base):
  8. __tablename__ = "skill_installation"
  9. skill_id: Mapped[str] = mapped_column(String(36), index=True)
  10. skill_version_id: Mapped[str] = mapped_column(String(36), index=True)
  11. install_scope: Mapped[str] = mapped_column(String(32), default="tenant", index=True)
  12. scope_id: Mapped[str] = mapped_column(String(64), index=True)
  13. status: Mapped[str] = mapped_column(String(32), default="installed", index=True)
  14. config_json: Mapped[dict[str, JSONValue]] = mapped_column(JSON, default=dict)
  15. installed_by: Mapped[str | None] = mapped_column(String(36), nullable=True)
  16. installed_time: Mapped[datetime | None] = mapped_column(DateTime, nullable=True)