Add project_id to merge_request_diff_commits_b5377a7a34
What does this MR do and why?
Adds project_id
to merge_request_diff_commits_b5377a7a34
as a desired
sharding key for eventual backfill and schedules an index to be created
asynchronously.
Database
Up
SQL
main: == [advisory_lock_connection] object_id: 118420, pg_backend_pid: 57190
main: == 20240802194745 AddProjectIdToMergeRequestDiffCommitsB5377a7a34: migrating ==
main: -- add_column(:merge_request_diff_commits_b5377a7a34, :project_id, :bigint)
main: -> 0.0073s
main: == 20240802194745 AddProjectIdToMergeRequestDiffCommitsB5377a7a34: migrated (0.0106s)
main: == [advisory_lock_connection] object_id: 118420, pg_backend_pid: 57190
ci: == [advisory_lock_connection] object_id: 118700, pg_backend_pid: 57192
ci: == 20240802194745 AddProjectIdToMergeRequestDiffCommitsB5377a7a34: migrating ==
ci: -- add_column(:merge_request_diff_commits_b5377a7a34, :project_id, :bigint)
ci: -> 0.0015s
ci: == 20240802194745 AddProjectIdToMergeRequestDiffCommitsB5377a7a34: migrated (0.0090s)
ci: == [advisory_lock_connection] object_id: 118700, pg_backend_pid: 57192
main: == [advisory_lock_connection] object_id: 119140, pg_backend_pid: 57195
main: == 20240802194749 PrepareIndexMergeRequestDiffCommitsB5377a7a34OnProjectId: migrating
main: -- index_exists?(:merge_request_diff_commits_b5377a7a34, :project_id, {:name=>"index_merge_request_diff_commits_b5377a7a34_on_project_id", :algorithm=>:concurrently})
main: -> 0.0023s
main: -- add_index_options(:merge_request_diff_commits_b5377a7a34, :project_id, {:name=>"index_merge_request_diff_commits_b5377a7a34_on_project_id", :algorithm=>:concurrently})
main: -> 0.0002s
main: == 20240802194749 PrepareIndexMergeRequestDiffCommitsB5377a7a34OnProjectId: migrated (0.0523s)
main: == [advisory_lock_connection] object_id: 119140, pg_backend_pid: 57195
ci: == [advisory_lock_connection] object_id: 119600, pg_backend_pid: 57197
ci: == 20240802194749 PrepareIndexMergeRequestDiffCommitsB5377a7a34OnProjectId: migrating
ci: -- index_exists?(:merge_request_diff_commits_b5377a7a34, :project_id, {:name=>"index_merge_request_diff_commits_b5377a7a34_on_project_id", :algorithm=>:concurrently})
ci: -> 0.0011s
ci: -- add_index_options(:merge_request_diff_commits_b5377a7a34, :project_id, {:name=>"index_merge_request_diff_commits_b5377a7a34_on_project_id", :algorithm=>:concurrently})
ci: -> 0.0001s
ci: == 20240802194749 PrepareIndexMergeRequestDiffCommitsB5377a7a34OnProjectId: migrated (0.0187s)
ci: == [advisory_lock_connection] object_id: 119600, pg_backend_pid: 57197
Down
SQL
main: == [advisory_lock_connection] object_id: 118420, pg_backend_pid: 50069
main: == 20240802194749 PrepareIndexMergeRequestDiffCommitsB5377a7a34OnProjectId: reverting
main: -- index_name(:merge_request_diff_commits_b5377a7a34, "index_merge_request_diff_commits_b5377a7a34_on_project_id")
main: -> 0.0000s
main: == 20240802194749 PrepareIndexMergeRequestDiffCommitsB5377a7a34OnProjectId: reverted (0.0434s)
main: == [advisory_lock_connection] object_id: 118420, pg_backend_pid: 50069
main: == [advisory_lock_connection] object_id: 117880, pg_backend_pid: 54450
main: == 20240802194745 AddProjectIdToMergeRequestDiffCommitsB5377a7a34: reverting ==
main: -- remove_column(:merge_request_diff_commits_b5377a7a34, :project_id)
main: -> 0.0013s
main: == 20240802194745 AddProjectIdToMergeRequestDiffCommitsB5377a7a34: reverted (0.0046s)
main: == [advisory_lock_connection] object_id: 117880, pg_backend_pid: 54450
ci: == [advisory_lock_connection] object_id: 117880, pg_backend_pid: 58640
ci: == 20240802194749 PrepareIndexMergeRequestDiffCommitsB5377a7a34OnProjectId: reverting
ci: -- index_name(:merge_request_diff_commits_b5377a7a34, "index_merge_request_diff_commits_b5377a7a34_on_project_id")
ci: -> 0.0001s
ci: == 20240802194749 PrepareIndexMergeRequestDiffCommitsB5377a7a34OnProjectId: reverted (0.0253s)
ci: == [advisory_lock_connection] object_id: 117880, pg_backend_pid: 58640
ci: == [advisory_lock_connection] object_id: 117880, pg_backend_pid: 63084
ci: == 20240802194745 AddProjectIdToMergeRequestDiffCommitsB5377a7a34: reverting ==
ci: -- remove_column(:merge_request_diff_commits_b5377a7a34, :project_id)
ci: -> 0.0012s
ci: == 20240802194745 AddProjectIdToMergeRequestDiffCommitsB5377a7a34: reverted (0.0091s)
ci: == [advisory_lock_connection] object_id: 117880, pg_backend_pid: 63084
Related to #464108 (closed)
Edited by Matt Kasa