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):