1234567891011121314151617181920212223242526272829 |
- from sqlalchemy import ForeignKey, Integer, String, Date, Time
- from sqlalchemy.orm import DeclarativeBase, Mapped, mapped_column, relationship
- from sqlalchemy.dialects.mysql.base import LONGTEXT, MEDIUMTEXT
- from datetime import date, time
- class Base(DeclarativeBase):
- pass
- class StatusMeldung(Base):
- __tablename__ = "status_meldung"
- datum: Mapped[date] = mapped_column(Date, primary_key=True)
- kunde: Mapped[str] = mapped_column(ForeignKey("kunden.kunde"), primary_key=True)
- kunde_ref: Mapped["Kunde"] = relationship()
- aufgabe: Mapped[str] = mapped_column(String(30), primary_key=True)
- start: Mapped[time] = mapped_column(Time, primary_key=True)
- ende: Mapped[time] = mapped_column(Time)
- fehlerbericht_import: Mapped[LONGTEXT] = mapped_column(LONGTEXT, nullable=True)
- fehlerbericht: Mapped[LONGTEXT] = mapped_column(LONGTEXT, nullable=True)
- anzahl: Mapped[int] = mapped_column(Integer, default=0)
- bearbeitet: Mapped[int] = mapped_column(Integer, default=0)
- kommentar_id: Mapped[int] = mapped_column(Integer, default=0)
- class Kunde(Base):
- __tablename__ = "kunden"
- kunde: Mapped[str] = mapped_column(String(50), primary_key=True)
- whitelist: Mapped[MEDIUMTEXT] = mapped_column(MEDIUMTEXT)
|