From 3e3f7ac958a6609e14b25407ff63cd71d7801064 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Wed, 14 Aug 2024 12:12:12 -0500 Subject: [PATCH] fix: cascade deletes for User -> UserRole --- src/wuttjamaican/db/model/auth.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/wuttjamaican/db/model/auth.py b/src/wuttjamaican/db/model/auth.py index 5d24854..5aee1df 100644 --- a/src/wuttjamaican/db/model/auth.py +++ b/src/wuttjamaican/db/model/auth.py @@ -188,9 +188,8 @@ class User(Base): role_refs = orm.relationship( 'UserRole', back_populates='user', + cascade='all, delete-orphan', cascade_backrefs=False, - # TODO - # cascade='all, delete-orphan', doc=""" List of :class:`UserRole` instances belonging to the user.