From 53041da5cf11f12fe354041075f19cdba2064146 Mon Sep 17 00:00:00 2001 From: skrzepto Date: Jun 09 2016 18:47:41 +0000 Subject: fixing the delete-user script by cascading the delete to other tables --- diff --git a/hubs/models.py b/hubs/models.py index 8dee5ff..742b113 100755 --- a/hubs/models.py +++ b/hubs/models.py @@ -107,7 +107,7 @@ class Association(BASE): primary_key=True) role = sa.Column(sa.Enum(*roles), primary_key=True) - user = relation("User", backref="associations") + user = relation("User", backref=backref('associations', cascade="all, delete-orphan")) hub = relation("Hub", backref="associations") @classmethod