Commit 9825ba47 authored by Adam Hegyi's avatar Adam Hegyi

Merge branch...

Merge branch '348872-should-index-index_epics_on_lock_version-on-epics-be-in-init_structure-sql' into 'master'

Resolve "should INDEX index_epics_on_lock_version ON epics be in init_structure.sql ?"

See merge request gitlab-org/gitlab!77674
parents f5f7e2ca e8383742
# 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