-
- Downloads
Migrate MR commits and diffs to new tables
Previously, we stored these as serialised fields - `st_{commits,diffs}` - on the `merge_request_diffs` table. These now have their own tables - `merge_request_diff_{commits,diffs}` - with a column for each attribute of the serialised data. Add a background migration to go through the existing MR diffs and migrate them to the new format. Ignore any contents that cannot be displayed. Assuming that we have 5 million rows to migrate, and each batch of 2,500 rows can be completed in 5 minutes, this will take about 7 days to migrate everything.
Showing
- app/models/merge_request_diff.rb 1 addition, 5 deletionsapp/models/merge_request_diff.rb
- db/post_migrate/20170703130158_schedule_merge_request_diff_migrations.rb 33 additions, 0 deletions.../20170703130158_schedule_merge_request_diff_migrations.rb
- lib/gitlab/background_migration/deserialize_merge_request_diffs_and_commits.rb 107 additions, 0 deletions..._migration/deserialize_merge_request_diffs_and_commits.rb
- spec/lib/gitlab/background_migration/deserialize_merge_request_diffs_and_commits_spec.rb 188 additions, 0 deletions...ation/deserialize_merge_request_diffs_and_commits_spec.rb
- spec/migrations/schedule_merge_request_diff_migrations_spec.rb 59 additions, 0 deletions...migrations/schedule_merge_request_diff_migrations_spec.rb
Please register or sign in to comment