Commit 996e5c5a authored by Tiger Watson's avatar Tiger Watson

Merge branch '204787-remove-cleanup-chat-names' into 'master'

Remove Project#cleanup_chat_names method and index

See merge request gitlab-org/gitlab!37054
parents 38d0c0de 768757d3
......@@ -109,7 +109,6 @@ class Project < ApplicationRecord
after_update :update_forks_visibility_level
before_destroy :remove_private_deploy_keys
before_destroy :cleanup_chat_names
use_fast_destroy :build_trace_chunks
......@@ -1941,17 +1940,6 @@ class Project < ApplicationRecord
import_export_upload&.export_file
end
# Before 12.9 we did not correctly clean up chat names and this causes issues.
# In 12.9, we add a foreign key relationship, but this code is used ensure the chat names are cleaned up while a post
# migration enables the foreign key relationship.
#
# This should be removed in 13.0.
#
# https://gitlab.com/gitlab-org/gitlab/issues/204787
def cleanup_chat_names
ChatName.where(service: services.select(:id)).delete_all
end
def full_path_slug
Gitlab::Utils.slugify(full_path.to_s)
end
......
---
title: Remove index from chat_names and service_id
merge_request: 37054
author:
type: other
# frozen_string_literal: true
class RemoveIndexChatNameServiceId < ActiveRecord::Migration[6.0]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
def up
remove_concurrent_index :chat_names, :service_id
end
def down
add_concurrent_index :chat_names, :service_id
end
end
72c7ca9e1284483e653d6d8dc16103f104502d7cd569cb3f7ab75e932807a661
\ No newline at end of file
......@@ -19024,8 +19024,6 @@ CREATE INDEX index_boards_on_project_id ON public.boards USING btree (project_id
CREATE INDEX index_broadcast_message_on_ends_at_and_broadcast_type_and_id ON public.broadcast_messages USING btree (ends_at, broadcast_type, id);
CREATE INDEX index_chat_names_on_service_id ON public.chat_names USING btree (service_id);
CREATE UNIQUE INDEX index_chat_names_on_service_id_and_team_id_and_chat_id ON public.chat_names USING btree (service_id, team_id, chat_id);
CREATE UNIQUE INDEX index_chat_names_on_user_id_and_service_id ON public.chat_names USING btree (user_id, service_id);
......
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