From 7a9ef8e10ca1f12cc52aec12ed5bfbaa0c1e58c6 Mon Sep 17 00:00:00 2001 From: P3ngSaM <61768364+P3ngSaM@users.noreply.github.com> Date: Tue, 29 Nov 2022 15:34:18 +0800 Subject: [PATCH] =?UTF-8?q?changes=20=E5=88=A0=E9=99=A4=E8=AF=84=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App/Model/RatingFlowModel.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/App/Model/RatingFlowModel.py b/App/Model/RatingFlowModel.py index 2636c8a..61a6bd9 100644 --- a/App/Model/RatingFlowModel.py +++ b/App/Model/RatingFlowModel.py @@ -17,8 +17,8 @@ class RatingFlow(Base): scorecard = Column(String(64), index=True, comment="打分卡") scorecard_id = Column(String(16), comment="打分卡ID") - nodes = relationship("RatingFlowNode", backref="rating_flow") - rating_flow_participant = relationship("RatingFlowParticipant", back_populates="rating_flow") + nodes = relationship("RatingFlowNode", backref="rating_flow", passive_deletes=True) + rating_flow_participant = relationship("RatingFlowParticipant", back_populates="rating_flow", passive_deletes=True) class RatingFlowParticipant(Base): @@ -40,7 +40,7 @@ class RatingFlowNode(Base): node_name = Column(String(32), comment="流程节点名称") status = Column(Boolean, default=0, comment="流程节点状态") obj_id = Column(String(24), default=None, comment="流程内容mongoID") - rating_process_id = Column(String(16), ForeignKey("rating_flow.id"), comment="评级流程ID") + rating_process_id = Column(String(16), ForeignKey("rating_flow.id", ondelete='CASCADE'), comment="评级流程ID") Base.metadata.create_all(bind=engine)