Alter foreign key for *_access_levels to cascade delete when their protected ref is deleted.
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Currently PushAccessLevel, MergeAccessLevel & CreateAccessLevel are being destroyed using dependant: :destroy when their ProtectedRef is destroyed.
The foreign keys for these need to be updated to enforce deletion in the database instead of by rails.
https://docs.gitlab.com/ee/development/foreign_keys.html#dependent-removals
Sadly I think this will require removing and re-adding the constraint: https://stackoverflow.com/a/10356720
Edited by 🤖 GitLab Bot 🤖