Commit 0532dc5a authored by Andreas Brandl's avatar Andreas Brandl

Explicitly state index name for create and remove

https://gitlab.com/gitlab-org/gitlab/-/issues/223041#note_381295112
parent d63664c8
......@@ -12,9 +12,9 @@ class SetProperLockVersionIndices < ActiveRecord::Migration[6.0]
remove_concurrent_index :merge_requests, :lock_version, where: "lock_version IS NULL"
remove_concurrent_index :issues, :lock_version, where: "lock_version IS NULL"
add_concurrent_index :epics, :id, where: "lock_version IS NULL"
add_concurrent_index :merge_requests, :id, where: "lock_version IS NULL"
add_concurrent_index :issues, :id, where: "lock_version IS NULL"
add_concurrent_index :epics, :id, where: "lock_version IS NULL", name: 'index_epics_on_id'
add_concurrent_index :merge_requests, :id, where: "lock_version IS NULL", name: 'index_merge_requests_on_id'
add_concurrent_index :issues, :id, where: "lock_version IS NULL", name: 'index_issues_on_id'
end
def down
......@@ -22,8 +22,8 @@ class SetProperLockVersionIndices < ActiveRecord::Migration[6.0]
add_concurrent_index :merge_requests, :lock_version, where: "lock_version IS NULL"
add_concurrent_index :issues, :lock_version, where: "lock_version IS NULL"
remove_concurrent_index :epics, :id, where: "lock_version IS NULL"
remove_concurrent_index :merge_requests, :id, where: "lock_version IS NULL"
remove_concurrent_index :issues, :id, where: "lock_version IS NULL"
remove_concurrent_index_by_name :epics, name: 'index_epics_on_id'
remove_concurrent_index_by_name :merge_requests, name: 'index_merge_requests_on_id'
remove_concurrent_index_by_name :issues, name: 'index_issues_on_id'
end
end
......@@ -9,10 +9,10 @@ class LockVersionCleanupForEpics < ActiveRecord::Migration[6.0]
def up
validate_not_null_constraint :epics, :lock_version
remove_concurrent_index :epics, :id, where: "lock_version IS NULL"
remove_concurrent_index_by_name :epics, name: 'index_epics_on_id'
end
def down
add_concurrent_index :epics, :id, where: "lock_version IS NULL"
add_concurrent_index :epics, :id, where: "lock_version IS NULL", name: 'index_epics_on_id'
end
end
......@@ -9,10 +9,10 @@ class LockVersionCleanupForMergeRequests < ActiveRecord::Migration[6.0]
def up
validate_not_null_constraint :merge_requests, :lock_version
remove_concurrent_index :merge_requests, :id, where: "lock_version IS NULL"
remove_concurrent_index_by_name :merge_requests, name: 'index_merge_requests_on_id'
end
def down
add_concurrent_index :merge_requests, :id, where: "lock_version IS NULL"
add_concurrent_index :merge_requests, :id, where: "lock_version IS NULL", name: 'index_merge_requests_on_id'
end
end
......@@ -9,10 +9,10 @@ class LockVersionCleanupForIssues < ActiveRecord::Migration[6.0]
def up
validate_not_null_constraint :issues, :lock_version
remove_concurrent_index :issues, :id, where: "lock_version IS NULL"
remove_concurrent_index_by_name :issues, name: 'index_issues_on_id'
end
def down
add_concurrent_index :issues, :id, where: "lock_version IS NULL"
add_concurrent_index :issues, :id, where: "lock_version IS NULL", name: 'index_issues_on_id'
end
end
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