execution_log.py 759 B

1234567891011121314151617
  1. from sqlalchemy import String, Text
  2. from sqlalchemy.dialects.sqlite import JSON
  3. from sqlalchemy.orm import Mapped, mapped_column
  4. from core_db import AuditMixin, Base, TenantMixin, VersionMixin
  5. from core_shared import JSONValue
  6. class ExecutionLog(TenantMixin, AuditMixin, VersionMixin, Base):
  7. __tablename__ = "execution_log"
  8. run_id: Mapped[str] = mapped_column(String(36), index=True)
  9. node_run_id: Mapped[str | None] = mapped_column(String(36), nullable=True, index=True)
  10. event_type: Mapped[str] = mapped_column(String(64), index=True)
  11. level: Mapped[str] = mapped_column(String(16), default="info")
  12. message: Mapped[str] = mapped_column(Text)
  13. detail_json: Mapped[dict[str, JSONValue] | None] = mapped_column(JSON, nullable=True)