diff --git a/chado/__init__.py b/chado/__init__.py index a77e888..3819738 100755 --- a/chado/__init__.py +++ b/chado/__init__.py @@ -217,6 +217,7 @@ class Db(Base): # Inspired from https://bitbucket.org/zzzeek/sqlalchemy/wiki/UsageRecipes/ManyToManyOrphan # In chado, a feature can be part of multiple analysis, using the analysisfeature table # With the following code, when we delete an analysis, it also deletes all features that were only part of this single analysis + # FIXME This is slow for analysis with many features, it runs 1 delete query per feature @event.listens_for(self.session, 'after_flush') def delete_feature_orphans(session, ctx): # List all features that were attached to a deleted analysis