Documentation + rubocop for checking that foreign key constraints require an index
What does this MR do?
Adds documentation and a rubocop. See https://gitlab.com/gitlab-org/gitlab-ce/issues/49789.
The rubocop does not match the case where a column exists already and we add the FK constraint with add_concurrent_foreign_key
. This is because we might already have an index on that column and I do not see a way to check for this. Is there?
Does this MR meet the acceptance criteria?
-
Documentation created/updated - Conforms to the code review guidelines
-
Has been reviewed by a Backend maintainer -
Has been reviewed by a Database specialist
-
-
Conforms to the style guides -
If you have multiple commits, please combine them into a few logically organized commits by squashing them -
End-to-end tests pass ( package-and-qa
manual pipeline job)
What are the relevant issue numbers?
Edited by Rémy Coutable