|
- # Postgres table model for vehicles
- from sqlalchemy import (
- Column,
- Integer,
- String,
- ARRAY,
- )
- from db.base import Base
-
-
- class Vehicle(Base):
- __tablename__ = "vehicles"
- Id = Column(Integer, primary_key=True, index=True)
- Model = Column(String, nullable=False)
- Year = Column(Integer, nullable=False)
- LicensePlate = Column(String, nullable=False)
- Type = Column(String, nullable=False)
- AssignedDriverIds = Column(ARRAY(Integer), nullable=True)
- CurrentLocation = Column(ARRAY(String), nullable=True)
- Fuel = Column(Integer, nullable=False)
- Mileage = Column(Integer, nullable=False)
- MaintenanceNotes = Column(ARRAY(String), nullable=True)
|