bug_report.py 914 B

1234567891011121314151617181920
  1. from datetime import datetime
  2. from sqlalchemy import Boolean, DateTime, Integer, String, Text, func
  3. from sqlalchemy.orm import Mapped, mapped_column
  4. from backend.app.core.database import Base
  5. class BugReport(Base):
  6. __tablename__ = "bug_reports"
  7. id: Mapped[int] = mapped_column(primary_key=True)
  8. description: Mapped[str] = mapped_column(Text)
  9. reporter_email: Mapped[str | None] = mapped_column(String(255), nullable=True)
  10. github_issue_number: Mapped[int | None] = mapped_column(Integer, nullable=True)
  11. github_issue_url: Mapped[str | None] = mapped_column(String(500), nullable=True)
  12. status: Mapped[str] = mapped_column(String(20), default="submitted")
  13. error_message: Mapped[str | None] = mapped_column(Text, nullable=True)
  14. email_sent: Mapped[bool] = mapped_column(Boolean, default=False)
  15. created_at: Mapped[datetime] = mapped_column(DateTime, server_default=func.now())