inveniosoftware / invenio-access

Invenio module for common role based access control.
https://invenio-access.readthedocs.io
MIT License
3 stars 49 forks source link

models: use "passive_deletes=True" for cascading deletes #173

Open slint opened 4 years ago

slint commented 4 years ago

Read "ORM-level “delete” cascade vs. FOREIGN KEY level “ON DELETE” cascade" note in https://docs.sqlalchemy.org/en/13/orm/cascades.html#delete for the explanation.

TLDR: without this parameter, instead of a fast DB-level cascade trigger, a slow ORM-level cascade takes place