You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
863 B

  1. from sqlalchemy import Column, Integer, String, ForeignKey, DateTime
  2. from sqlalchemy.orm import relationship
  3. from db.base import Base
  4. class FuelingTask(Base):
  5. Id = Column(Integer, primary_key=True, index=True)
  6. VehicleId = Column(ForeignKey("vehicle.Id"), nullable=False)
  7. DriverId = Column(ForeignKey("user.Id"), nullable=False)
  8. CreatedById = Column(ForeignKey("user.Id"), nullable=False)
  9. Date = Column(DateTime, nullable=False)
  10. Description = Column(String, nullable=True)
  11. Cost = Column(Integer, nullable=False)
  12. FuelRefilled = Column(Integer, nullable=False)
  13. GasStationName = Column(String, nullable=False)
  14. ImageBefore = Column(String, nullable=False)
  15. ImageAfter = Column(String, nullable=False)
  16. CreatedBy = relationship(
  17. "User", back_populates="fuelingTasks", foreign_keys="FuelingTask.CreatedById"
  18. )