model.py 953 B

12345678910111213141516171819202122
  1. from sqlalchemy import Integer, String, Date, Time
  2. from sqlalchemy.orm import DeclarativeBase, Mapped, mapped_column
  3. from sqlalchemy.dialects.mysql.base import LONGTEXT
  4. from datetime import date, time
  5. class Base(DeclarativeBase):
  6. pass
  7. class StatusMeldung(Base):
  8. __tablename__ = "status_meldung"
  9. datum: Mapped[date] = mapped_column(Date, primary_key=True)
  10. kunde: Mapped[str] = mapped_column(String(50), primary_key=True)
  11. aufgabe: Mapped[str] = mapped_column(String(30))
  12. start: Mapped[time] = mapped_column(Time, primary_key=True)
  13. ende: Mapped[time] = mapped_column(Time)
  14. fehlerbericht_import: Mapped[LONGTEXT] = mapped_column(LONGTEXT, nullable=True)
  15. fehlerbericht: Mapped[LONGTEXT] = mapped_column(LONGTEXT, nullable=True)
  16. anzahl: Mapped[int] = mapped_column(Integer, default=0)
  17. bearbeitet: Mapped[int] = mapped_column(Integer, default=0)
  18. kommentar_id: Mapped[int] = mapped_column(Integer, default=0)