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.
 
 

28 line
785 B

  1. # Postgres table model for vehicles
  2. from sqlalchemy import (
  3. Column,
  4. Integer,
  5. String,
  6. DateTime,
  7. Boolean,
  8. URL,
  9. ARRAY,
  10. ForeignKey,
  11. )
  12. from sqlalchemy.orm import relationship
  13. from db.base import Base
  14. class Vehicle(Base):
  15. __tablename__ = "vehicles"
  16. Id = Column(Integer, primary_key=True, index=True)
  17. Model = Column(String, nullable=False)
  18. Year = Column(Integer, nullable=False)
  19. LicensePlate = Column(String, nullable=False)
  20. Type = Column(String, nullable=False)
  21. AssignedDriverIds = Column(ARRAY(Integer), nullable=True)
  22. CurrentLocation = Column(ARRAY(String), nullable=True)
  23. Fuel = Column(Integer, nullable=False)
  24. Mileage = Column(Integer, nullable=False)
  25. MaintenanceNotes = Column(ARRAY(String), nullable=True)