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
4b85b4dc
Commit
4b85b4dc
authored
Apr 27, 2018
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix schema and refactoring migration file
parent
c0b4f8ac
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
24 deletions
+26
-24
db/post_migrate/20180424151928_fill_file_store.rb.rb
db/post_migrate/20180424151928_fill_file_store.rb.rb
+26
-24
No files found.
db/post_migrate/20180424151928_fill_file_store.rb.rb
View file @
4b85b4dc
...
@@ -10,13 +10,8 @@ class FillFileStore < ActiveRecord::Migration
...
@@ -10,13 +10,8 @@ class FillFileStore < ActiveRecord::Migration
self
.
table_name
=
'ci_job_artifacts'
self
.
table_name
=
'ci_job_artifacts'
BATCH_SIZE
=
10_000
BATCH_SIZE
=
10_000
def
self
.
queue_background_migration
def
self
.
params_for_background_migration
self
.
class
.
where
(
file_store:
nil
).
tap
do
|
relation
|
yield
self
.
where
(
file_store:
nil
),
'FillFileStoreJobArtifact'
,
5
.
minutes
,
BATCH_SIZE
queue_background_migration_jobs_by_range_at_intervals
(
relation
,
'FillFileStoreJobArtifact'
,
5
.
minutes
,
batch_size:
BATCH_SIZE
)
end
end
end
end
end
...
@@ -25,13 +20,8 @@ class FillFileStore < ActiveRecord::Migration
...
@@ -25,13 +20,8 @@ class FillFileStore < ActiveRecord::Migration
self
.
table_name
=
'lfs_objects'
self
.
table_name
=
'lfs_objects'
BATCH_SIZE
=
10_000
BATCH_SIZE
=
10_000
def
self
.
queue_background_migration
def
self
.
params_for_background_migration
self
.
class
.
where
(
file_store:
nil
).
tap
do
|
relation
|
yield
self
.
where
(
file_store:
nil
),
'FillFileStoreLfsObject'
,
5
.
minutes
,
BATCH_SIZE
queue_background_migration_jobs_by_range_at_intervals
(
relation
,
'FillFileStoreLfsObject'
,
5
.
minutes
,
batch_size:
BATCH_SIZE
)
end
end
end
end
end
...
@@ -40,13 +30,8 @@ class FillFileStore < ActiveRecord::Migration
...
@@ -40,13 +30,8 @@ class FillFileStore < ActiveRecord::Migration
self
.
table_name
=
'uploads'
self
.
table_name
=
'uploads'
BATCH_SIZE
=
10_000
BATCH_SIZE
=
10_000
def
self
.
queue_background_migration
def
self
.
params_for_background_migration
self
.
class
.
where
(
store:
nil
).
tap
do
|
relation
|
yield
self
.
where
(
store:
nil
),
'FillFileStoreUpload'
,
5
.
minutes
,
BATCH_SIZE
queue_background_migration_jobs_by_range_at_intervals
(
relation
,
'FillFileStoreUpload'
,
5
.
minutes
,
batch_size:
BATCH_SIZE
)
end
end
end
end
end
...
@@ -60,9 +45,26 @@ class FillFileStore < ActiveRecord::Migration
...
@@ -60,9 +45,26 @@ class FillFileStore < ActiveRecord::Migration
# - lfs_objects.file_store
# - lfs_objects.file_store
# - uploads.store
# - uploads.store
FillFileStore
::
JobArtifact
.
queue_background_migration
FillFileStore
::
JobArtifact
.
params_for_background_migration
do
|
relation
,
class_name
,
delay_interval
,
batch_size
|
FillFileStore
::
LfsObject
.
queue_background_migration
queue_background_migration_jobs_by_range_at_intervals
(
relation
,
FillFileStore
::
Upload
.
queue_background_migration
class_name
,
delay_interval
,
batch_size:
batch_size
)
end
FillFileStore
::
LfsObject
.
params_for_background_migration
do
|
relation
,
class_name
,
delay_interval
,
batch_size
|
queue_background_migration_jobs_by_range_at_intervals
(
relation
,
class_name
,
delay_interval
,
batch_size:
batch_size
)
end
FillFileStore
::
Upload
.
params_for_background_migration
do
|
relation
,
class_name
,
delay_interval
,
batch_size
|
queue_background_migration_jobs_by_range_at_intervals
(
relation
,
class_name
,
delay_interval
,
batch_size:
batch_size
)
end
end
end
def
down
def
down
...
...
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