Nullify merge_request_metrics pipeline_id on pipeline deletion
- Apr 25, 2022
-
-
Patrick Bajao authored
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
-