mirror of
https://gitlab.com/gitlab-org/gitlab-foss.git
synced 2025-07-25 16:03:48 +00:00
20 lines
483 B
Ruby
20 lines
483 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Gitlab
|
|
module BackgroundMigration
|
|
class DeleteOrphanedRoutes < BatchedMigrationJob
|
|
operation_name :delete_orphaned_routes
|
|
feature_category :groups_and_projects
|
|
|
|
def perform
|
|
each_sub_batch do |sub_batch|
|
|
sub_batch
|
|
.joins('LEFT JOIN namespaces ON namespaces.id = routes.namespace_id')
|
|
.where(namespaces: { id: nil })
|
|
.delete_all
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|