-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Overheads are not deleted when its Project is deleted.
I added a "cascade='all'" to the Overheads relationship in Projects.
But then deleting a Project caused a SQLAlchemy error:
StaleDataError: DELETE statement on table many to many
I'm assuming from the many-to-many relationship between Overheads and BudgetItems.
Using the solution here: http://stackoverflow.com/questions/28824401/sqlalchemy-attempting-to-twice-delete-many-to-many-secondary-relationship
And adding
engine.dialect.supports_sane_rowcount = engine.dialect.supports_sane_multi_rowcount = False
to init.py fixed the error.
Keeping this issue open in case there are any side effects.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels