Closed JakobTolkemit closed 1 year ago
But why do we want to cascade those things? Are you accidentally trying to delete orders?
Our unit tests run the \Doctrine\Common\DataFixtures\Purger\ORMPurger
before every test.
That's where we run into failing foreign key checks.
Turns out, we currently deal with that, by extending the \Tests\Sylius\ShopApiPlugin\Controller\JsonApiTestCase
and turning off foreign key checks for the purge.
Am I misunderstanding the configs? Does the cascade mean it gets cascaded to the configured entity or said entity will cascade to related one?
To me it looks like deleting a CustomerOptionValuePrice would also remove the Product. Which should never happen. Or removing a Translation will also remove the main object. If that's the case, the cascade should be inversed and on the other side.
If I'm wrong tho, I think this is fine.
It's the other way around. When the main object gets deleted, we also remove the translation, and when the product gets deleted we also remove the CustomerOptionValuePrice that was created for that product.
Looks good to me, merge it and tag it?
Makes our resource entities extendable. Also some deletions didn't get cascaded outside of doctrine.