Skip to content

Remove broadcast_messages.namespace_id column

What does this MR do and why?

This column was added to bring the broadcast messages feature to groups but this column was never used. This feature won't work with the new cells architecture https://docs.gitlab.com/ee/architecture/blueprints/cells/index.html so we're removing it. The column was already ignored in this commit ca9fe296.

Migration output

up
bin/rails db:migrate
WARNING: This version of GitLab depends on gitlab-shell 14.22.0, but you're running 14.20.0. Please update gitlab-shell.
main: == [advisory_lock_connection] object_id: 227760, pg_backend_pid: 6948
main: == 20230602063059 RemoveBroadcastMessagesNamespaceIdColumn: migrating =========
main: -- remove_column(:broadcast_messages, :namespace_id)
main:    -> 0.0048s
main: == 20230602063059 RemoveBroadcastMessagesNamespaceIdColumn: migrated (0.0096s)

main: == [advisory_lock_connection] object_id: 227760, pg_backend_pid: 6948
ci: == [advisory_lock_connection] object_id: 227940, pg_backend_pid: 6950
ci: == 20230602063059 RemoveBroadcastMessagesNamespaceIdColumn: migrating =========
ci: -- remove_column(:broadcast_messages, :namespace_id)
ci:    -> 0.0030s
ci: == 20230602063059 RemoveBroadcastMessagesNamespaceIdColumn: migrated (0.0145s)

ci: == [advisory_lock_connection] object_id: 227940, pg_backend_pid: 6950
down
bin/rails db:rollback:main
WARNING: This version of GitLab depends on gitlab-shell 14.22.0, but you're running 14.20.0. Please update gitlab-shell.
main: == [advisory_lock_connection] object_id: 227500, pg_backend_pid: 5877
main: == 20230602063059 RemoveBroadcastMessagesNamespaceIdColumn: reverting =========
main: -- column_exists?(:broadcast_messages, :namespace_id)
main:    -> 0.1046s
main: -- add_column(:broadcast_messages, :namespace_id, :bigint)
main:    -> 0.0015s
main: -- transaction_open?()
main:    -> 0.0000s
main: -- view_exists?(:postgres_partitions)
main:    -> 0.0007s
main: -- index_exists?(:broadcast_messages, :namespace_id, {:name=>"index_broadcast_messages_on_namespace_id", :algorithm=>:concurrently})
main:    -> 0.0019s
main: -- execute("SET statement_timeout TO 0")
main:    -> 0.0003s
main: -- add_index(:broadcast_messages, :namespace_id, {:name=>"index_broadcast_messages_on_namespace_id", :algorithm=>:concurrently})
main:    -> 0.0023s
main: -- execute("RESET statement_timeout")
main:    -> 0.0004s
main: == 20230602063059 RemoveBroadcastMessagesNamespaceIdColumn: reverted (0.1251s)

main: == [advisory_lock_connection] object_id: 227500, pg_backend_pid: 5877
➜ bin/rails db:rollback:ci
WARNING: This version of GitLab depends on gitlab-shell 14.22.0, but you're running 14.20.0. Please update gitlab-shell.
ci: == [advisory_lock_connection] object_id: 227440, pg_backend_pid: 6533
ci: == 20230602063059 RemoveBroadcastMessagesNamespaceIdColumn: reverting =========
ci: -- column_exists?(:broadcast_messages, :namespace_id)
ci:    -> 0.0873s
ci: -- add_column(:broadcast_messages, :namespace_id, :bigint)
ci:    -> 0.0015s
ci: -- transaction_open?()
ci:    -> 0.0000s
ci: -- view_exists?(:postgres_partitions)
ci:    -> 0.0007s
 .g/COMMIT_EDITMSG+                                                                                                                                                                                                                                                     buffers
ci: -- index_exists?(:broadcast_messages, :namespace_id, {:name=>"index_broadcast_messages_on_namespace_id", :algorithm=>:concurrently})
ci:    -> 0.0020s
ci: -- execute("SET statement_timeout TO 0")
ci:    -> 0.0002s
ci: -- add_index(:broadcast_messages, :namespace_id, {:name=>"index_broadcast_messages_on_namespace_id", :algorithm=>:concurrently})
ci:    -> 0.0034s
ci: -- execute("RESET statement_timeout")
ci:    -> 0.0004s
ci: == 20230602063059 RemoveBroadcastMessagesNamespaceIdColumn: reverted (0.1165s)

How to set up and validate locally

Run bin/rails db:migrate.

MR acceptance checklist

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

Related to #398151 (closed)

Merge request reports

Loading