|
123456789101112131415161718192021222324252627 |
- # Postgres table model for vehicles
- from sqlalchemy import (
- Column,
- Integer,
- String,
- DateTime,
- Boolean,
- URL,
- ARRAY,
- ForeignKey,
- )
- from sqlalchemy.orm import relationship
- 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)
|