Commit 5059c8bd authored by Adam Hegyi's avatar Adam Hegyi

Merge branch 'ab/forward-fix-lock-version-migration' into 'master'

Explicitly state index name for create and remove

See merge request gitlab-org/gitlab!37201
parents 0b3e51d5 0532dc5a
......@@ -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