Blacklist the use of add_reference

In https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/32257/ the method add_reference was used for adding a foreign key and index. This method does not create the index or foreign key concurrently, which will lead to downtime. We were lucky enough to hit a statement timeout before this could do serious damage, but we may not be so lucky in the future.

To prevent this from happening again we need to blacklist the use of add_reference just as how we blacklisted add_index and similar methods. I am marking this as gitlab-ce~3713902 since it is very easy to make this mistake again.

cc @jprovaznik @tkuah

Assignee Loading
Time tracking Loading