Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cascade delete issues with Overhead #218

Open
nvernooy opened this issue Nov 9, 2015 · 0 comments
Open

Cascade delete issues with Overhead #218

nvernooy opened this issue Nov 9, 2015 · 0 comments

Comments

@nvernooy
Copy link
Contributor

nvernooy commented Nov 9, 2015

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.

nvernooy added a commit that referenced this issue Nov 9, 2015
… to valuation markup. Added a solution to #218 for overhead delete issue.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant