diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-02 06:08:01 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-02 06:08:01 +0300 |
commit | 796b00a98a82fcbe082c9343fd4efcccc77478dc (patch) | |
tree | 257bcb124f57cb91a8dff75e69649e8a2f91c51d /app | |
parent | 93dcf45d441bc884b167f4338380c8c888e9b86f (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
-rw-r--r-- | app/models/project.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/app/models/project.rb b/app/models/project.rb index 03b247f213b..93ac9b64a98 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -107,6 +107,7 @@ 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 @@ -1908,6 +1909,17 @@ 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 |