diff --git a/buildingmotif/database/tables.py b/buildingmotif/database/tables.py index e3f8dd07..cc239629 100644 --- a/buildingmotif/database/tables.py +++ b/buildingmotif/database/tables.py @@ -97,6 +97,7 @@ class DBTemplate(Base): primaryjoin=id == DepsAssociation.dependant_id, secondaryjoin=id == DepsAssociation.dependee_id, back_populates="dependants", + cascade="all,delete", ) dependants: Mapped[List["DBTemplate"]] = relationship( "DBTemplate",