|
1234567891011121314151617181920 |
- # PostgreSQL table model for users
- from sqlalchemy import Column, Integer, String, ForeignKey
- from sqlalchemy.orm import relationship
- from db.base import Base
-
-
- class User(Base):
- Id = Column(Integer, primary_key=True, index=True)
- Name = Column(String, nullable=False)
- MiddleName = Column(String, nullable=True)
- LastName = Column(String, nullable=False)
- GovernmentId = Column(String, nullable=False)
- Address = Column(String, nullable=False)
- ContactNumber = Column(String, nullable=False)
- Email = Column(String, nullable=False)
- Role = Column(String, nullable=False)
- DrivingLicenseNumber = Column(String, nullable=True)
- AssignedVehicle = Column(Integer, ForeignKey("vehicle.Id"), nullable=True)
- vehicle = relationship("Vehicle", back_populates="driver")
- HashedPassword = Column(String, nullable=False)
|