19 lines
623 B
Python
19 lines
623 B
Python
from sqlalchemy import Column, Integer, String, ForeignKey
|
|
from sqlalchemy.orm import relationship
|
|
|
|
from app.domain.models.base import BaseModel
|
|
from app.settings import settings
|
|
|
|
|
|
class AppointmentFile(BaseModel):
|
|
__tablename__ = 'appointment_files'
|
|
__table_args__ = {"schema": settings.SCHEMA}
|
|
|
|
file_path = Column(String, nullable=False)
|
|
file_title = Column(String, nullable=False)
|
|
|
|
appointment_id = Column(Integer, ForeignKey(f'{settings.SCHEMA}.appointments.id', ondelete='CASCADE'),
|
|
nullable=False)
|
|
|
|
appointment = relationship('Appointment', back_populates='files')
|