Is your feature request related to a problem? Please describe.
Deleting a user should cascade to the related rows in the tables defined by this module.
Currently, attempting to delete a user marks the foreignkey as null but since nullable=False, an integrity error is raised and the transaction is aborted.
Describe the solution you'd like
Add a backref cascade in appropriate places so that related rows gets deleted nicely. Example:
from sqlalchemy.orm import backref
class RemoteAccount(db.Model, Timestamp):
# ...
user = db.relationship(User, backref=backref('remote_accounts', cascade="all,delete"))
"""SQLAlchemy relationship to user."""
Describe alternatives you've considered
I have to delete from the bottom up i.e. figure out all models keying into User and delete those... ugh
Is your feature request related to a problem? Please describe.
Deleting a user should cascade to the related rows in the tables defined by this module.
Currently, attempting to delete a user marks the foreignkey as null but since
nullable=False, an integrity error is raised and the transaction is aborted.Describe the solution you'd like
Add a backref cascade in appropriate places so that related rows gets deleted nicely. Example:
Describe alternatives you've considered
I have to delete from the bottom up i.e. figure out all models keying into User and delete those... ugh