This commit is contained in:
2024-04-28 06:42:04 +03:00
parent ca0d424727
commit 4d01a17002
2 changed files with 3 additions and 6 deletions

View File

@@ -25,7 +25,7 @@ class Deal(BaseModel):
created_at = Column(DateTime, nullable=False, comment='Дата создания')
current_status = Column(Integer, nullable=False, comment='Текущий статус')
client_id = Column(Integer, ForeignKey('clients.id'), nullable=False, comment='ID клиента', cascade='all, delete-orphan')
client_id = Column(Integer, ForeignKey('clients.id', ondelete='CASCADE'), nullable=False, comment='ID клиента')
client = relationship('Client', backref='deals')
status_history = relationship('DealStatusHistory', back_populates='deal', cascade="all, delete-orphan")