diff options
author | Sean McGivern <sean@gitlab.com> | 2017-11-21 16:58:08 +0000 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2017-11-28 16:13:40 +0000 |
commit | 4ebbfe5d3e0dbe06346ee0c64a8f62ec11f9b6e8 (patch) | |
tree | dc8e3259e258ef0f1c558db7008c88b8cdf5d185 /spec/lib/gitlab/import_export/project_tree_restorer_spec.rb | |
parent | 9cb38f0433930f85964ab3c3f07d677676fa265b (diff) | |
download | gitlab-ce-4ebbfe5d3e0dbe06346ee0c64a8f62ec11f9b6e8.tar.gz |
Remove serialised diff and commit columns
The st_commits and st_diffs columns on merge_request_diffs historically held the
YAML-serialised data for a merge request diff, in a variety of formats.
Since 9.5, these have been migrated in the background to two new tables:
merge_request_diff_commits and merge_request_diff_files. That has the advantage
that we can actually query the data (for instance, to find out how many commits
we've stored), and that it can't be in a variety of formats, but must match the
new schema.
This is the final step of that journey, where we drop those columns and remove
all references to them. This is a breaking change to the importer, because we
can no longer import diffs created in the old format, and we cannot guarantee
the export will be in the new format unless it was generated after this commit.
Diffstat (limited to 'spec/lib/gitlab/import_export/project_tree_restorer_spec.rb')
-rw-r--r-- | spec/lib/gitlab/import_export/project_tree_restorer_spec.rb | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/spec/lib/gitlab/import_export/project_tree_restorer_spec.rb b/spec/lib/gitlab/import_export/project_tree_restorer_spec.rb index 4d78a4b9b13..0ab3afd0074 100644 --- a/spec/lib/gitlab/import_export/project_tree_restorer_spec.rb +++ b/spec/lib/gitlab/import_export/project_tree_restorer_spec.rb @@ -95,26 +95,12 @@ describe Gitlab::ImportExport::ProjectTreeRestorer do end end - it 'has the correct data for merge request st_diffs' do - # makes sure we are renaming the custom method +utf8_st_diffs+ into +st_diffs+ - # one MergeRequestDiff uses the new format, where st_diffs is expected to be nil - - expect(MergeRequestDiff.where.not(st_diffs: nil).count).to eq(8) - end - it 'has the correct data for merge request diff files' do - expect(MergeRequestDiffFile.where.not(diff: nil).count).to eq(9) + expect(MergeRequestDiffFile.where.not(diff: nil).count).to eq(55) end - it 'has the correct data for merge request diff commits in serialised and table formats' do - expect(MergeRequestDiff.where.not(st_commits: nil).count).to eq(7) - expect(MergeRequestDiffCommit.count).to eq(6) - end - - it 'has the correct time for merge request st_commits' do - st_commits = MergeRequestDiff.where.not(st_commits: nil).first.st_commits - - expect(st_commits.first[:committed_date]).to be_kind_of(Time) + it 'has the correct data for merge request diff commits' do + expect(MergeRequestDiffCommit.count).to eq(77) end it 'has the correct data for merge request latest_merge_request_diff' do |