summaryrefslogtreecommitdiff
path: root/lib/gitlab/background_migration/update_existing_subgroup_to_match_visibility_level_of_parent.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/background_migration/update_existing_subgroup_to_match_visibility_level_of_parent.rb')
-rw-r--r--lib/gitlab/background_migration/update_existing_subgroup_to_match_visibility_level_of_parent.rb21
1 files changed, 0 insertions, 21 deletions
diff --git a/lib/gitlab/background_migration/update_existing_subgroup_to_match_visibility_level_of_parent.rb b/lib/gitlab/background_migration/update_existing_subgroup_to_match_visibility_level_of_parent.rb
deleted file mode 100644
index 9e330f7c008..00000000000
--- a/lib/gitlab/background_migration/update_existing_subgroup_to_match_visibility_level_of_parent.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-# frozen_string_literal: true
-
-module Gitlab
- module BackgroundMigration
- # This background migration updates children of group to match visibility of a parent
- class UpdateExistingSubgroupToMatchVisibilityLevelOfParent
- def perform(parents_groups_ids, level)
- groups_ids = Gitlab::ObjectHierarchy.new(Group.where(id: parents_groups_ids))
- .base_and_descendants
- .where("visibility_level > ?", level)
- .select(:id)
-
- return if groups_ids.empty?
-
- Group
- .where(id: groups_ids)
- .update_all(visibility_level: level)
- end
- end
- end
-end