node_artifact.py 1015 B

1234567891011121314151617181920
  1. from core_db import AuditMixin, Base, EntityMixin
  2. from core_shared import JSONValue
  3. from sqlalchemy import Integer, String, Text
  4. from sqlalchemy import JSON
  5. from sqlalchemy.orm import Mapped, mapped_column
  6. class NodeArtifact(EntityMixin, AuditMixin, Base):
  7. __tablename__ = "node_artifact"
  8. run_id: Mapped[str] = mapped_column(String(36), index=True)
  9. node_run_id: Mapped[str] = mapped_column(String(36), index=True)
  10. node_id: Mapped[str] = mapped_column(String(128), index=True)
  11. artifact_type: Mapped[str] = mapped_column(String(64), index=True)
  12. name: Mapped[str] = mapped_column(String(128))
  13. mime_type: Mapped[str | None] = mapped_column(String(128), nullable=True)
  14. content_text: Mapped[str | None] = mapped_column(Text, nullable=True)
  15. content_json: Mapped[dict[str, JSONValue] | None] = mapped_column(JSON, nullable=True)
  16. storage_uri: Mapped[str | None] = mapped_column(String(512), nullable=True)
  17. size_bytes: Mapped[int | None] = mapped_column(Integer, nullable=True)