Closed vincent-peugnet closed 3 years ago
This is what I got when trying to delete an userClass:
An exception occurred while executing 'DELETE FROM user_class WHERE id = ?' with params [12]:
SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`antilope`.`sharable`, CONSTRAINT `FK_83471A9C57EEBAA5` FOREIGN KEY (`visible_by_id`) REFERENCES `user_class` (`id`))
Sounds like it's working !!! But is it normal that you did not generate any migrations? even after you've removed 'delete' cascade option from doctrine ??? @n-peugnet
When I make doctrine:migration:diff
doctrine tell me that:
No changes detected in your mapping information.
So I imagine it's good ??
As we read from Doctrine doc, this option was the doctrine one, which emulate at doctrine level the feature of ON DELETE 'cascade'
from SQL, which I kept.
It was only another software layer hover the database, so no migration needed.
Conclusion is : OH YEAH BABY
Good job on the rest of the deletion job, like the users moving and the warnings BTW!
https://github.com/vincent-peugnet/antilope/commit/9da99c1fa0adbe71480a3e6c0491f5f0a2a4ca26#r46392536
Plizzz help me @n-peugnet !! :face_with_head_bandage: