Skip to content

Documentation + rubocop for checking that foreign key constraints require an index

Andreas Brandl requested to merge ab-49789-fks-want-indexes into master

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?

What are the relevant issue numbers?

https://gitlab.com/gitlab-org/gitlab-ce/issues/49789

Edited by Rémy Coutable

Merge request reports