Add delete cascade to alchemy model

This commit is contained in:
Matthias 2020-08-13 16:55:43 +02:00
parent 1a305ea8b0
commit da2a515d0b

View File

@ -183,7 +183,7 @@ class Trade(_DECL_BASE):
id = Column(Integer, primary_key=True) id = Column(Integer, primary_key=True)
orders = relationship("Order", order_by="Order.id") orders = relationship("Order", order_by="Order.id", cascade="all, delete-orphan")
exchange = Column(String, nullable=False) exchange = Column(String, nullable=False)
pair = Column(String, nullable=False, index=True) pair = Column(String, nullable=False, index=True)