acardona/CATMAID — Issue #240: Remove a neuron from object tree
Author: unidesigner
Created: 2012-02-07 16:14:15+00:00
State: open

With the update migration adding missing ON DELETE CASCADE, when deleting a neuron from the object tree, all associated skeletons, treenodes etc. are removed EXCEPT the presynaptic/postsynaptic terminal class_instances. They cannot be deleted with the ON CASCADE (which is very slow btw when there are many class_instances), and would have to be deleted by hand in instance.operation.php on line 75.

After removal of the neuron, the check-database script gives
```terminal 30 <-> synapse 29 No treenode found that models that terminal
Traceback (most recent call last):
File "./check-database.py", line 175, in
treenode_id, terminal_class = rows[0]
IndexError: list index out of range
```

Before fixing that, I'd rather vote for removing the whole, unnecessary pre/post synaptic terminal class_instance mess in the annotation domain - maybe together with a potential Django rewrite.