-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cascade DELETEs in the database #363
base: develop
Are you sure you want to change the base?
Conversation
…lates/etc when deleting libraries
f72bc74
to
a6c50cf
Compare
@gtfierro I just rebased which mostly required changes around of exceptions, cause your adding exceptions PR went through to develop. Let me know if anything looks messed up. |
Documenting what appears to be the desired functionality so that it can be tested. On Model Delete
On Library Delete
Standing issues:
|
This looks great, @TShapinsky ! Thanks for doing the merge. I just wrote a couple unit tests to verify the behavior under different conditions. I decided to see what would happen if we had a default CASCADE between dependencies. |
So if a library is deleted it should cascade delete all libraries which have dependent links to that library. I think that makes sense. We should make sure that the deletes don't accidentally cascade the other direction. I haven't looked at your new tests yet so you may have already addressed that. Unless we want to go through the process of rebuilding dependencies for all libraries anytime one is imported I think this is the right call. One other thought. If this isn't already the case, we should make sure that you can hotswap a library without destroying the entire dependency tree. For Example: if you overwrite a library it should rebuild the dependencies but not cascade delete everything. This could probably be a different issue. |
I'm pretty sure the issue is that if I create library A with templates, and then I create library B which depends on A through B's templates, and the nI delete library A, I need to decide what happens to A's templates and B's templates' dependencies on A's templates. Right now (outside of this PR) I think we leave dangling references, which causes exceptions in SQLalchemy when you interact with that table after messing with the dependency structure.