Revision 5551
Added by Aaron Marcuse-Kubitza over 12 years ago
schemas/tree_cross-links.sql | ||
---|---|---|
45 | 45 |
END IF; |
46 | 46 |
|
47 | 47 |
/* Note: We don't need an ON DELETE trigger to update the descendants' |
48 |
ancestors when a node is deleted, because the taxonconcept.parent_id foreign
|
|
49 |
key is ON DELETE CASCADE, which just removes all the descendants anyway. */
|
|
48 |
ancestors when a node is deleted, because the |
|
49 |
taxonconcept_ancestor.ancestor_id foreign key is ON DELETE CASCADE. */
|
|
50 | 50 |
END; |
51 | 51 |
$BODY$ |
52 | 52 |
LANGUAGE plpgsql VOLATILE |
schemas/vegbien.sql | ||
---|---|---|
712 | 712 |
END IF; |
713 | 713 |
|
714 | 714 |
/* Note: We don't need an ON DELETE trigger to update the descendants' |
715 |
ancestors when a node is deleted, because the taxonconcept.parent_id foreign
|
|
716 |
key is ON DELETE CASCADE, which just removes all the descendants anyway. */
|
|
715 |
ancestors when a node is deleted, because the |
|
716 |
taxonconcept_ancestor.ancestor_id foreign key is ON DELETE CASCADE. */
|
|
717 | 717 |
END; |
718 | 718 |
$$; |
719 | 719 |
|
Also available in: Unified diff
schemas/vegbien.sql: taxonconcept: taxonconcept_update_ancestors() trigger: Corrected comment explaining why we don't need an ON DELETE trigger to say that this is because the foreign key for taxonconcept_ancestor.ancestor_id, not taxonconcept.parent_id, is ON DELETE CASCADE. The auto-deletion will also occur if taxonconcept.parent_id is ON DELETE CASCADE, because taxonconcept_ancestor.taxonconcept_id is ON DELETE CASCADE, but it is not actually necessary to have cascading deletes on taxonconcept.parent_id (and SET NULL may in fact sometimes be more appropriate).