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_rules into the dedicated organization_push_rules table.
  • organization_push_rules has a native PostgreSQL foreign key on organization_id with ON DELETE CASCADE (fk_rails_14972ce31e), so org deletions are handled at the database level.
  • The push_rules table no longer holds organization-level rows. With the new project_id presence validation on PushRule, a project-less (org-level) push rule can no longer be created in push_rules at all.

Therefore the push_rules → organizations async_delete LFK entry is dead config.

Scope

  • Remove the push_rules: → organizations (organization_id, async_delete) block from config/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
Edited by Emma Park