fix: delete associated ssh public keys with account deletion

Signed-off-by: Leonidas Spyropoulos <artafinde@archlinux.org>
This commit is contained in:
Leonidas Spyropoulos 2022-11-21 13:39:43 +00:00
parent bce5b81acd
commit ff92e95f7a
No known key found for this signature in database
GPG key ID: 59E43E106B247368
2 changed files with 32 additions and 1 deletions

View file

@ -13,7 +13,7 @@ class SSHPubKey(Base):
User = relationship(
"User",
backref=backref("ssh_pub_keys", lazy="dynamic"),
backref=backref("ssh_pub_keys", lazy="dynamic", cascade="all, delete"),
foreign_keys=[__table__.c.UserID],
)