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.
 
 

20 line
815 B

  1. # PostgreSQL table model for users
  2. from sqlalchemy import Column, Integer, String, DateTime, ForeignKey
  3. from sqlalchemy.orm import relationship
  4. from db.base import Base
  5. class User(Base):
  6. Id = Column(Integer, primary_key=True, index=True)
  7. Name = Column(String, nullable=False)
  8. MiddleName = Column(String, nullable=True)
  9. LastName = Column(String, nullable=False)
  10. BirthDate = Column(DateTime, nullable=False)
  11. ContactNumber = Column(String, nullable=False)
  12. Email = Column(String, nullable=False)
  13. Role = Column(String, nullable=False)
  14. DrivingLicenseNumber = Column(String, nullable=True)
  15. AssignedVehicle = Column(Integer, ForeignKey("vehicle.Id"), nullable=True)
  16. vehicle = relationship("Vehicle", back_populates="driver")
  17. HashedPassword = Column(String, nullable=False)