From da2a515d0be4597e5282dd58a3eedf28db281bf6 Mon Sep 17 00:00:00 2001 From: Matthias Date: Thu, 13 Aug 2020 16:55:43 +0200 Subject: [PATCH] Add delete cascade to alchemy model --- freqtrade/persistence/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/freqtrade/persistence/models.py b/freqtrade/persistence/models.py index 14e2b0da8..4efdacef8 100644 --- a/freqtrade/persistence/models.py +++ b/freqtrade/persistence/models.py @@ -183,7 +183,7 @@ class Trade(_DECL_BASE): 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) pair = Column(String, nullable=False, index=True)