23 lines
803 B
Python
23 lines
803 B
Python
from sqlalchemy import Column, Integer, String, ForeignKey
|
|
from sqlalchemy.orm import relationship
|
|
|
|
from database import Base
|
|
from .CustomBase import CustomBase
|
|
|
|
|
|
class Doctors(Base, CustomBase):
|
|
__tablename__ = "doctors"
|
|
|
|
id = Column(Integer, primary_key=True, index=True)
|
|
name = Column(String)
|
|
age = Column(Integer, nullable=True)
|
|
email = Column(String, unique=True, index=True, nullable=True)
|
|
phone = Column(String, unique=True, index=True)
|
|
address = Column(String, nullable=True)
|
|
|
|
clinic_id = Column(Integer, ForeignKey("clinics.id"), nullable=False, index=True)
|
|
clinic = relationship("Clinics", back_populates="doctors")
|
|
|
|
appointments = relationship("Appointments", back_populates="doctor")
|
|
calendars = relationship("Calenders", back_populates="doctor")
|