Cleanup migrations adding merge_request_diff_files.project FK
This foreign key caused the incident https://gitlab.com/gitlab-com/gl-infra/production/-/issues/19474 . It was added in https://gitlab.com/gitlab-org/gitlab/-/merge_requests/177799 . The problem is that we added a foreign key before adding an index. This means that all statements like `DELETE FROM projects ...` will need to scan the entire `merge_request_diff_files` table to check if the foreign key is valid. This was causing timeouts. In order to resolve the incident we've already manually deleted this migration on GitLab.com . This MR additionally adds another migration to remove the foreign key to clean up any environments where this migration may have already run.
上级
4baa2f5a
No related branches found
No related tags found
显示
- db/migrate/20250224231330_add_project_id_to_merge_request_diff_files.rb 7 个添加, 1 个删除...50224231330_add_project_id_to_merge_request_diff_files.rb
- db/migrate/20250312061803_remove_project_id_fk_from_merge_request_diff_files.rb 20 个添加, 0 个删除...803_remove_project_id_fk_from_merge_request_diff_files.rb
- db/schema_migrations/20250312061803 1 个添加, 0 个删除db/schema_migrations/20250312061803
- db/structure.sql 0 个添加, 3 个删除db/structure.sql
- spec/db/schema_spec.rb 1 个添加, 1 个删除spec/db/schema_spec.rb
db/schema_migrations/20250312061803
0 → 100644
想要评论请 注册 或 登录