You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
We have database rows related via foreign keys. In the future they may also correspond to external objects (files, S3 objects). If a user deletes their account, we need to delete related files. Thus, making deletes cascade may leave objects behind.
Describe the solution you'd like
Four possible solutions:
Add ON DELETE CASCADE to the model so this logic is applied to the DB
Add cascade="all,delete,delete-orphan" to the ORM only so that deleting rows via Python (but not direct DML) cascades
Use 1 or 2 on rows that have no external objects and do manual deletes on rows with external objects
Always do it explicitly
I'm leaning toward 1+3 in that having cascade logic applied to FKs is senseible but that we want to have a worker queue model for when a user deletes an account with 5000 messages each its own external file in S3. This would support offline deletes in cases where a delete would time out an HTTP request.
Is your feature request related to a problem? Please describe.
We have database rows related via foreign keys. In the future they may also correspond to external objects (files, S3 objects). If a user deletes their account, we need to delete related files. Thus, making deletes cascade may leave objects behind.
Describe the solution you'd like
Four possible solutions:
ON DELETE CASCADE
to the model so this logic is applied to the DBcascade="all,delete,delete-orphan"
to the ORM only so that deleting rows via Python (but not direct DML) cascadesI'm leaning toward 1+3 in that having cascade logic applied to FKs is senseible but that we want to have a worker queue model for when a user deletes an account with 5000 messages each its own external file in S3. This would support offline deletes in cases where a delete would time out an HTTP request.
Blocks (or at least strongly influences) #474
The text was updated successfully, but these errors were encountered: