|
- from sqlalchemy import Column, Integer, String, ForeignKey, DateTime
- from sqlalchemy.orm import relationship
- from db.base import Base
-
- class FuelingTask(Base):
- Id = Column(Integer, primary_key=True, index=True)
- VehicleId = Column(ForeignKey("vehicle.Id"), nullable=False)
- DriverId = Column(ForeignKey("user.Id"), nullable=False)
- CreatedById = Column(ForeignKey("user.Id"), nullable=False)
- Date = Column(DateTime, nullable=False)
- Description = Column(String, nullable=True)
- Cost = Column(Integer, nullable=False)
- FuelRefilled = Column(Integer, nullable=False)
- GasStationName = Column(String, nullable=False)
- ImageBefore = Column(String, nullable=False)
- ImageAfter = Column(String, nullable=False)
- CreatedBy = relationship("User", back_populates="fuelingTasks", foreign_keys="FuelingTask.CreatedById")
|