Commit e8383742 authored by dfrazao-gitlab's avatar dfrazao-gitlab Committed by Adam Hegyi

Remove lock version indexes

Removes the following indexes if they exist.

- index_issues_on_lock_version
- index_merge_requests_on_lock_version
- index_epics_on_lock_version

Changelog: fixed

Relates to https://gitlab.com/gitlab-org/gitlab/-/merge_requests/77674
parent 684ef443
# frozen_string_literal: true
class RemoveLockVersionIndexes < Gitlab::Database::Migration[1.0]
disable_ddl_transaction!
INDEXES = {
issues: 'index_issues_on_lock_version',
merge_requests: 'index_merge_requests_on_lock_version',
epics: 'index_epics_on_lock_version'
}
def up
INDEXES.each do |table, index_name|
remove_concurrent_index_by_name table, index_name
end
end
def down
INDEXES.each do |table, index_name|
add_concurrent_index table, :lock_version, where: "lock_version IS NULL", name: index_name
end
end
end
cedca81a6dc1562cf0ed5f17217c52420a1cb9a74acece8d67eb1bcb948a7181
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment