Add support for *_path de-duplication to mrd_files
As part of the partitioning/sharding/DB size work:
Add support for
*_path
de-duplication in Rails
-
Add custom getter in MergeRequestDiffFile
to returnold_path
whennew_path
isNULL
-
We should also look at DiffFile#to_hash
(this is inapp/models/concern
). This method is called whenever we build theGitlab::Git::DiffCollection
based onMergeRequestDiffFiles
.
-
- Update
*_path
values before they get to the DB-
Add before_validation
to setnew_path = nil if old_path == new_path
- Blocked by #559142 (closed)
-
Update MergeRequestDiff#build_merge_request_diff_files
as we build the rows we bulk insert. (seeMergeRequestDiff#save_diffs
)
-
Edited by Kerri Miller