VirtoCommerce / vc-platform-core

Project moved to https://github.com/VirtoCommerce/vc-platform/tree/release/3.0.0
Other
38 stars 32 forks source link

Feature/association fix #564

Closed wsimon closed 5 years ago

wsimon commented 5 years ago

Anytime you try to delete an association or update its Type/Group (which deletes and recreates the association), a DB error occurs:

cannot insert the value null into column

DeleteBehavior of Restrict causes this error because it is trying to update the non-nullable ItemId to be NULL instead of deleting the association.

See these docs for more information

tatarincev commented 5 years ago

@wsimon Thanks for your contribution. We use this technique for other modules when database restrictions do not allow cascading deletion due to any reasons. Then we create a migration and database using the Restrict rule for cascade deletion, and then change it to Cascade. It seems we forgot to do this for this module.