From 0447afa2e520d845c1785ae80db201cfea0729ae Mon Sep 17 00:00:00 2001 From: Kevin Morris Date: Mon, 6 Dec 2021 21:30:23 -0800 Subject: [PATCH] fix(PackageNotification): add missing backref cascade Signed-off-by: Kevin Morris --- aurweb/models/package_notification.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/aurweb/models/package_notification.py b/aurweb/models/package_notification.py index 97dbe38f..327b92a6 100644 --- a/aurweb/models/package_notification.py +++ b/aurweb/models/package_notification.py @@ -15,12 +15,14 @@ class PackageNotification(Base): } User = relationship( - _User, backref=backref("notifications", lazy="dynamic"), + _User, backref=backref("notifications", lazy="dynamic", + cascade="all, delete"), foreign_keys=[__table__.c.UserID]) PackageBase = relationship( _PackageBase, - backref=backref("notifications", lazy="dynamic"), + backref=backref("notifications", lazy="dynamic", + cascade="all, delete"), foreign_keys=[__table__.c.PackageBaseID]) def __init__(self, **kwargs):