v0.1
This commit is contained in:
@@ -25,7 +25,7 @@ class Deal(BaseModel):
|
|||||||
created_at = Column(DateTime, nullable=False, comment='Дата создания')
|
created_at = Column(DateTime, nullable=False, comment='Дата создания')
|
||||||
current_status = Column(Integer, nullable=False, comment='Текущий статус')
|
current_status = Column(Integer, nullable=False, comment='Текущий статус')
|
||||||
|
|
||||||
client_id = Column(Integer, ForeignKey('clients.id'), nullable=False, comment='ID клиента', cascade='all, delete')
|
client_id = Column(Integer, ForeignKey('clients.id'), nullable=False, comment='ID клиента', cascade='all, delete-orphan')
|
||||||
client = relationship('Client', backref='deals')
|
client = relationship('Client', backref='deals')
|
||||||
|
|
||||||
status_history = relationship('DealStatusHistory', back_populates='deal', cascade="all, delete-orphan")
|
status_history = relationship('DealStatusHistory', back_populates='deal', cascade="all, delete-orphan")
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ class DealService(BaseModel):
|
|||||||
nullable=False,
|
nullable=False,
|
||||||
comment='ID Сделки',
|
comment='ID Сделки',
|
||||||
primary_key=True,
|
primary_key=True,
|
||||||
cascade='all, delete')
|
cascade='all, delete-orphan')
|
||||||
deal = relationship('Deal', back_populates='services')
|
deal = relationship('Deal', back_populates='services')
|
||||||
|
|
||||||
service_id = Column(Integer, ForeignKey('services.id'), nullable=False, comment='ID Услуги', primary_key=True)
|
service_id = Column(Integer, ForeignKey('services.id'), nullable=False, comment='ID Услуги', primary_key=True)
|
||||||
@@ -26,7 +26,7 @@ class DealProduct(BaseModel):
|
|||||||
nullable=False,
|
nullable=False,
|
||||||
comment='ID Сделки',
|
comment='ID Сделки',
|
||||||
primary_key=True,
|
primary_key=True,
|
||||||
cascade='all, delete'
|
cascade='all, delete-orphan'
|
||||||
)
|
)
|
||||||
deal = relationship('Deal', back_populates='products')
|
deal = relationship('Deal', back_populates='products')
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user