Skip to content

Add support for ignoring false positives in missing foreign key constraint#61

Closed
chaadow wants to merge 1 commit intopawurb:mainfrom
chaadow:add_missing_fk_constraint_ignore_list
Closed

Add support for ignoring false positives in missing foreign key constraint#61
chaadow wants to merge 1 commit intopawurb:mainfrom
chaadow:add_missing_fk_constraint_ignore_list

Conversation

@chaadow
Copy link
Copy Markdown
Contributor

@chaadow chaadow commented Dec 16, 2025

Fixes #58

relies on pawurb/ruby-pg-extras#34

the missing_fk_constraints method can now accept an ignore_list parameter, allowing users to skip known false positives.

This is set in the configure block of the gem

RailsPgExtras.configure do |config|
  # Accepts an Array or a comma-separated String of entries like:
  # - "posts.category_id" (ignore a specific table+column)
  # - "category_id"       (ignore this column name for all tables)
  # - "posts.*"           (ignore all columns on a table)
  # - "*"                 (ignore everything)
  config.missing_fk_constraints_ignore_list = ["posts.category_id", "category_id"]

  # Or as a comma-separated string:
  # config.missing_fk_constraints_ignore_list = "posts.category_id, category_id"
end

…raints

Enhanced the `missing_fk_constraints` method to accept an `ignore_list` parameter, allowing users to skip known false positives.
@pawurb
Copy link
Copy Markdown
Owner

pawurb commented Dec 16, 2025

@chaadow I could not update this PR to rebase so I'll merge #63

@pawurb pawurb closed this Dec 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

add ignore list for missing_fk_indexes and missing_fk_constraints

2 participants