Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
83767dd0
Commit
83767dd0
authored
Jan 09, 2019
by
Toon Claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup dead code and comments
parent
082cc122
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
20 deletions
+5
-20
changelogs/unreleased/sh-fix-backfill-project-repo-migration.yml
...ogs/unreleased/sh-fix-backfill-project-repo-migration.yml
+5
-0
lib/gitlab/background_migration/backfill_project_repositories.rb
...lab/background_migration/backfill_project_repositories.rb
+0
-20
No files found.
changelogs/unreleased/sh-fix-backfill-project-repo-migration.yml
0 → 100644
View file @
83767dd0
---
title
:
Fix duplicate project disk path in BackfillLegacyProjectRepositories
merge_request
:
24213
author
:
type
:
changed
lib/gitlab/background_migration/backfill_project_repositories.rb
View file @
83767dd0
...
@@ -189,11 +189,7 @@ module Gitlab
...
@@ -189,11 +189,7 @@ module Gitlab
end
end
def
perform
(
start_id
,
stop_id
)
def
perform
(
start_id
,
stop_id
)
ActiveRecord
::
Base
.
logger
=
Logger
.
new
(
STDOUT
)
Gitlab
::
Database
.
bulk_insert
(
:project_repositories
,
project_repositories
(
start_id
,
stop_id
))
Gitlab
::
Database
.
bulk_insert
(
:project_repositories
,
project_repositories
(
start_id
,
stop_id
))
ActiveRecord
::
Base
.
logger
=
nil
end
end
private
private
...
@@ -204,12 +200,6 @@ module Gitlab
...
@@ -204,12 +200,6 @@ module Gitlab
end
end
def
project_repositories
(
start_id
,
stop_id
)
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
projects
.
without_project_repository
.
without_project_repository
.
includes
(
:route
,
parent:
[
:route
]).
references
(
:routes
)
.
includes
(
:route
,
parent:
[
:route
]).
references
(
:routes
)
...
@@ -219,16 +209,6 @@ module Gitlab
...
@@ -219,16 +209,6 @@ module Gitlab
.
compact
.
compact
end
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
)
def
build_attributes_for_project
(
project
)
{
{
project_id:
project
.
id
,
project_id:
project
.
id
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment