Jaguar-dart / jaguar_orm

Source-generated ORM with relations (one-to-one, one-to-many, many-to-many), preloading, cascading, polymorphic relations, etc
https://jaguar-dart.github.io
BSD 3-Clause "New" or "Revised" License
217 stars 52 forks source link

Fix of issue #99 in https://github.com/Jaguar-dart/jaguar_orm/issues/99: #100

Closed MartinHlavna closed 5 years ago

MartinHlavna commented 5 years ago

In case of optional ManyToMany relation,remove with cascade would fail if there were no entities in relation.

Wrapping deletion of pivot entities in if fixes this issue by not executing unnecessary delete statement.

tejainece commented 5 years ago

Thanks for the PR!

It only fixes part of the problem, right?

MartinHlavna commented 5 years ago

You're welcome. About fixing part of the problem - I have created two issues yesterday #99 which is fixed by this PR, and #101 which is another problem that I have realized during implementation of this fix.

tejainece commented 5 years ago

Ok. Are you planning to send a PR for #101 or should I fix it?