vincent-peugnet / antilope

Antilope private tracker for IRL sharing, allowing members to share anything inside communities.
https://antilope-alpha.club1.fr/
GNU Affero General Public License v3.0
9 stars 2 forks source link

finish user class delete #44

Closed vincent-peugnet closed 3 years ago

vincent-peugnet commented 3 years ago

https://github.com/vincent-peugnet/antilope/commit/9da99c1fa0adbe71480a3e6c0491f5f0a2a4ca26#r46392536

Plizzz help me @n-peugnet !! :face_with_head_bandage:

vincent-peugnet commented 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`))
vincent-peugnet commented 3 years ago

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 ??

n-peugnet commented 3 years ago

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.

vincent-peugnet commented 3 years ago

Conclusion is : OH YEAH BABY

n-peugnet commented 3 years ago

Good job on the rest of the deletion job, like the users moving and the warnings BTW!