Cleanup dead code and comments

This commit is contained in:
Toon Claes 2019-01-09 21:54:38 +01:00
parent 082cc12225
commit 83767dd0b3
2 changed files with 5 additions and 20 deletions

View File

@ -0,0 +1,5 @@
---
title: Fix duplicate project disk path in BackfillLegacyProjectRepositories
merge_request: 24213
author:
type: changed

View File

@ -189,11 +189,7 @@ module Gitlab
end
def perform(start_id, stop_id)
ActiveRecord::Base.logger = Logger.new(STDOUT)
Gitlab::Database.bulk_insert(:project_repositories, project_repositories(start_id, stop_id))
ActiveRecord::Base.logger = nil
end
private
@ -204,12 +200,6 @@ module Gitlab
end
def project_repositories(start_id, stop_id)
# .eager_load(:route, :parent, parent: [:route])
# .includes(:parent, :route, parent: [:route]).references(:namespaces)
# .includes(:parent).references(:namespaces)
# .joins(*routes_joins).references(:routes)
projects
.without_project_repository
.includes(:route, parent: [:route]).references(:routes)
@ -219,16 +209,6 @@ module Gitlab
.compact
end
def routes_joins
routes = Route.arel_table
projects = Project.arel_table
routes_projects = routes.alias('routes_projects')
projects.join(routes, Arel::Nodes::OuterJoin).on(projects[:namespace_id].eq(routes[:source_id]).and(routes[:source_type].eq('Namespace')))
.join(routes_projects, Arel::Nodes::OuterJoin).on(projects[:id].eq(routes_projects[:source_id]).and(routes_projects[:source_type].eq('Project')))
.join_sources
end
def build_attributes_for_project(project)
{
project_id: project.id,