Clean up unused push rules loose foreign key
Summary
The push_rules table still has a loose foreign key (LFK) config entry for organization_id, which is now obsolete and can be removed.
push_rules:
- table: organizations
column: organization_id
on_delete: async_delete(config/gitlab_loose_foreign_keys.yml, ~lines 854-857)
Why it's safe to remove
- Organization-level push rules have been migrated out of
push_rulesinto the dedicatedorganization_push_rulestable. organization_push_ruleshas a native PostgreSQL foreign key onorganization_idwithON DELETE CASCADE(fk_rails_14972ce31e), so org deletions are handled at the database level.- The
push_rulestable no longer holds organization-level rows. With the newproject_idpresence validation onPushRule, a project-less (org-level) push rule can no longer be created inpush_rulesat all.
Therefore the push_rules → organizations async_delete LFK entry is dead config.
Scope
- Remove the
push_rules:→organizations(organization_id,async_delete) block fromconfig/gitlab_loose_foreign_keys.yml - Remove any remaining now-dead supporting code related to this LFK
- Confirm no other references rely on this LFK entry before removal
Related
- Parent: #499156 (push_rules table approach)
- MR: !246324 (merged)
Edited by Emma Park