Skip to content

Support multiple columns for foreign_key_exists?

Simon Tomlinson requested to merge fix-fk-exists-multiple-columns into master

What does this MR do and why?

Describe in detail what your merge request does and why.

Previously foreign_key_exists? would incorrectly return false when looking for a foreign key with multiple columns. This was due to rails's handling of foreign keys, which does not support composite foreign keys.

Instead, re-implement the check directly using the postgres_foreign_keys view.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports

Loading