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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
a6ffefc7
Commit
a6ffefc7
authored
Sep 19, 2018
by
Matija Čupić
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Schedule background migration
parent
c2fbd867
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
0 deletions
+33
-0
db/post_migrate/20180916014356_populate_external_pipeline_source.rb
...grate/20180916014356_populate_external_pipeline_source.rb
+33
-0
No files found.
db/post_migrate/20180916014356_populate_external_pipeline_source.rb
0 → 100644
View file @
a6ffefc7
# frozen_string_literal: true
# See http://doc.gitlab.com/ce/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.
class
PopulateExternalPipelineSource
<
ActiveRecord
::
Migration
include
Gitlab
::
Database
::
MigrationHelpers
# Set this constant to true if this migration requires downtime.
DOWNTIME
=
false
MIGRATION
=
'PopulateExternalPipelineSource'
.
freeze
BATCH_SIZE
=
500
disable_ddl_transaction!
class
Pipeline
<
ActiveRecord
::
Base
include
EachBatch
self
.
table_name
=
'ci_pipelines'
end
def
up
Pipeline
.
where
(
source:
nil
).
tap
do
|
relation
|
queue_background_migration_jobs_by_range_at_intervals
(
relation
,
MIGRATION
,
5
.
minutes
,
batch_size:
BATCH_SIZE
)
end
end
def
down
# noop
end
end
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