Skip to content

Add namespace_id to notes

Heinrich Lee Yu requested to merge 416127-add-namespace-id-notes into master

What does this MR do and why?

This is going to be used for partitioning the table

Related to #416127 (closed)

Migration Output

Up

main: == [advisory_lock_connection] object_id: 223900, pg_backend_pid: 65771
main: == 20230718094246 AddNamespaceIdToNotes: migrating ============================
main: -- add_column(:notes, :namespace_id, :bigint)
main:    -> 0.0044s
main: == 20230718094246 AddNamespaceIdToNotes: migrated (0.0095s) ===================

main: == [advisory_lock_connection] object_id: 223900, pg_backend_pid: 65771
ci: == [advisory_lock_connection] object_id: 224200, pg_backend_pid: 65773
ci: == 20230718094246 AddNamespaceIdToNotes: migrating ============================
ci: -- add_column(:notes, :namespace_id, :bigint)
ci:    -> 0.0037s
ci: == 20230718094246 AddNamespaceIdToNotes: migrated (0.0194s) ===================

main: == [advisory_lock_connection] object_id: 224140, pg_backend_pid: 12812
main: == 20230718094501 PrepareNotesNamespaceIdIndex: migrating =====================
main: -- index_exists?(:notes, :namespace_id, {:name=>"index_notes_on_namespace_id", :algorithm=>:concurrently})
main:    -> 0.0054s
main: -- add_index_options(:notes, :namespace_id, {:name=>"index_notes_on_namespace_id", :algorithm=>:concurrently})
main:    -> 0.0002s
main: == 20230718094501 PrepareNotesNamespaceIdIndex: migrated (0.1370s) ============

main: == [advisory_lock_connection] object_id: 224140, pg_backend_pid: 12812
ci: == [advisory_lock_connection] object_id: 224480, pg_backend_pid: 12814
ci: == 20230718094501 PrepareNotesNamespaceIdIndex: migrating =====================
ci: -- index_exists?(:notes, :namespace_id, {:name=>"index_notes_on_namespace_id", :algorithm=>:concurrently})
ci:    -> 0.0066s
ci: -- add_index_options(:notes, :namespace_id, {:name=>"index_notes_on_namespace_id", :algorithm=>:concurrently})
ci:    -> 0.0001s
ci: == 20230718094501 PrepareNotesNamespaceIdIndex: migrated (0.0211s) ============

Down

ci: == [advisory_lock_connection] object_id: 223780, pg_backend_pid: 13367
ci: == 20230718094501 PrepareNotesNamespaceIdIndex: reverting =====================
ci: == 20230718094501 PrepareNotesNamespaceIdIndex: reverted (0.1875s) ============
main: == [advisory_lock_connection] object_id: 223780, pg_backend_pid: 13840
main: == 20230718094501 PrepareNotesNamespaceIdIndex: reverting =====================
main: == 20230718094501 PrepareNotesNamespaceIdIndex: reverted (0.2072s) ============

ci: == [advisory_lock_connection] object_id: 223560, pg_backend_pid: 66879
main: == [advisory_lock_connection] object_id: 223600, pg_backend_pid: 67373
main: == 20230718094246 AddNamespaceIdToNotes: reverting ============================
main: -- remove_column(:notes, :namespace_id)
main:    -> 0.0030s
main: == 20230718094246 AddNamespaceIdToNotes: reverted (0.0084s) ===================

main: == [advisory_lock_connection] object_id: 223600, pg_backend_pid: 67373
ci: == [advisory_lock_connection] object_id: 223560, pg_backend_pid: 67847
ci: == 20230718094246 AddNamespaceIdToNotes: reverting ============================
ci: -- remove_column(:notes, :namespace_id)
ci:    -> 0.0020s
ci: == 20230718094246 AddNamespaceIdToNotes: reverted (0.0153s) ===================

ci: == [advisory_lock_connection] object_id: 223560, pg_backend_pid: 67847

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Heinrich Lee Yu

Merge request reports

Loading