Nullify merge_request_metrics pipeline_id on pipeline deletion
Before, when a pipeline is deleted, the associated `merge_request_metrics` record will be deleted as well. This is a destructive thing as `merge_request_metrics` include other data not related to a pipeline. To fix this issue, instead of deleting the association record, we nullify the `pipeline_id` on `merge_request_metrics` instead. When this happens, related build data (`latest_build_started_at` and `latest_build_finished_at`) will be nullified as well. This is to ensure that when those data are requested, it'll still behave the same way as before. Changelog: fixed
显示
- config/gitlab_loose_foreign_keys.yml 1 个添加, 1 个删除config/gitlab_loose_foreign_keys.yml
- db/migrate/20220412060931_add_nullify_build_data_trigger_on_merge_request_metrics.rb 28 个添加, 0 个删除...dd_nullify_build_data_trigger_on_merge_request_metrics.rb
- db/schema_migrations/20220412060931 1 个添加, 0 个删除db/schema_migrations/20220412060931
- db/structure.sql 15 个添加, 0 个删除db/structure.sql
- spec/models/merge_request/metrics_spec.rb 39 个添加, 0 个删除spec/models/merge_request/metrics_spec.rb
加载中
想要评论请 注册 或 登录