From 763427017bde571435ff52e3fd1d66160f747cca Mon Sep 17 00:00:00 2001 From: fleaz Date: Fri, 24 Feb 2023 00:02:33 +0100 Subject: [PATCH] Cascade the models when deleting tags --- schmeckels/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/schmeckels/models.py b/schmeckels/models.py index 6e37727..ffcb464 100644 --- a/schmeckels/models.py +++ b/schmeckels/models.py @@ -51,7 +51,7 @@ class Tag(Base): name = Column(String, unique=True) reporting = Column(Boolean, default=True) description = Column(String) - transactions = relationship("Transaction", secondary=association_table, back_populates="tags") + transactions = relationship("Transaction", secondary=association_table, back_populates="tags", cascade="all") def __repr__(self): return f""