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.

преди 1 година
преди 1 година
преди 1 година
преди 1 година
123456789101112131415161718192021222324252627
  1. # Postgres table model for vehicles
  2. from sqlalchemy import (
  3. Column,
  4. Integer,
  5. String,
  6. ARRAY,
  7. )
  8. from sqlalchemy.orm import relationship
  9. from db.base import Base
  10. class Vehicle(Base):
  11. Id = Column(Integer, primary_key=True, index=True)
  12. Model = Column(String, nullable=False)
  13. Year = Column(Integer, nullable=False)
  14. LicensePlate = Column(String, nullable=False)
  15. Type = Column(String, nullable=False)
  16. CurrentLocation = Column(ARRAY(String), nullable=True)
  17. Fuel = Column(Integer, nullable=False)
  18. Mileage = Column(Integer, nullable=False)
  19. Status = Column(String, nullable=False)
  20. Capacity = Column(Integer, nullable=False)
  21. DriverHistory = Column(ARRAY(Integer), nullable=True)
  22. driver = relationship("User", back_populates="vehicle")
  23. auction = relationship("Auction", back_populates="vehicle")
  24. maintenanceJobs = relationship("MaintenanceJob", back_populates="Vehicle")