Skip to content
Snippets Groups Projects

Fix migration for removing MR diff indexes

Closed yorickpeterse-staging requested to merge fix-remove-merge-request-diff-unique-index into master
1 unresolved thread

This should take care of all the shenanigans as discussed in https://gitlab.com/gitlab-org/gitlab-ce/issues/22136.

cc @stanhu

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
8 8 DOWNTIME = false
9 9
10 10 def up
11 if index_exists?(:merge_request_diffs, :merge_request_id)
12 remove_index :merge_request_diffs, :merge_request_id
11 constraint_name = 'merge_request_diffs_merge_request_id_key'
12
13 transaction do
14 if index_exists?(:merge_request_diffs, :merge_request_id)
15 remove_index(:merge_request_diffs, :merge_request_id)
16 end
17
18 # In some bizarre cases PostgreSQL might have a separate unique constraint
19 # that we'll need to drop.
20 if constraint_exists?(constraint_name) && Gitlab::Database.postgresql?
  • yorickpeterse-staging Status changed to closed

    Status changed to closed

  • Please register or sign in to reply
    Loading