Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 

28 rader
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)