diff options
Diffstat (limited to 'db/migrate/20230328020316_delete_unused_index_on_merge_requests_on_state_id_and_merge_status.rb')
-rw-r--r-- | db/migrate/20230328020316_delete_unused_index_on_merge_requests_on_state_id_and_merge_status.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/db/migrate/20230328020316_delete_unused_index_on_merge_requests_on_state_id_and_merge_status.rb b/db/migrate/20230328020316_delete_unused_index_on_merge_requests_on_state_id_and_merge_status.rb new file mode 100644 index 00000000000..eac1d4e30c1 --- /dev/null +++ b/db/migrate/20230328020316_delete_unused_index_on_merge_requests_on_state_id_and_merge_status.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class DeleteUnusedIndexOnMergeRequestsOnStateIdAndMergeStatus < Gitlab::Database::Migration[2.1] + # TODO: Index to be destroyed synchronously in https://gitlab.com/gitlab-org/gitlab/-/issues/402491 + + def up + prepare_async_index_removal :merge_requests, [:state_id, :merge_status], + where: "((state_id = 1) AND ((merge_status)::text = 'can_be_merged'::text))", + name: 'idx_merge_requests_on_state_id_and_merge_status' + end + + def down + unprepare_async_index :merge_requests, [:state_id, :merge_status], + where: "((state_id = 1) AND ((merge_status)::text = 'can_be_merged'::text))", + name: 'idx_merge_requests_on_state_id_and_merge_status' + end +end |