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
Boxiang Sun
gitlab-ce
Commits
2d027056
Commit
2d027056
authored
Feb 20, 2018
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add index before going through builds in a migration
parent
dfef5437
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
db/post_migrate/20180212101928_schedule_build_stage_migration.rb
..._migrate/20180212101928_schedule_build_stage_migration.rb
+5
-0
No files found.
db/post_migrate/20180212101928_schedule_build_stage_migration.rb
View file @
2d027056
...
...
@@ -15,12 +15,17 @@ class ScheduleBuildStageMigration < ActiveRecord::Migration
def
up
disable_statement_timeout
add_concurrent_index
(
:ci_builds
,
:stage_id
,
where:
'stage_id IS NULL'
,
name:
'tmp_stage_id_partial_null_index'
)
Build
.
where
(
'stage_id IS NULL'
).
tap
do
|
relation
|
queue_background_migration_jobs_by_range_at_intervals
(
relation
,
MIGRATION
,
5
.
minutes
,
batch_size:
BATCH_SIZE
)
end
remove_concurrent_index_by_name
(
:ci_builds
,
'tmp_stage_id_partial_null_index'
)
end
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