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
7bc24ec2
Commit
7bc24ec2
authored
May 03, 2018
by
Dylan Griffith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract constants in 20180430143705_backfill_runner_type_for_ci_runners_post_migrate
parent
dc439a3b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
db/post_migrate/20180430143705_backfill_runner_type_for_ci_runners_post_migrate.rb
...43705_backfill_runner_type_for_ci_runners_post_migrate.rb
+5
-2
No files found.
db/post_migrate/20180430143705_backfill_runner_type_for_ci_runners_post_migrate.rb
View file @
7bc24ec2
...
...
@@ -3,14 +3,17 @@ class BackfillRunnerTypeForCiRunnersPostMigrate < ActiveRecord::Migration
DOWNTIME
=
false
PROJECT_RUNNER_TYPE
=
1
INSTANCE_RUNNER_TYPE
=
3
disable_ddl_transaction!
def
up
update_column_in_batches
(
:ci_runners
,
:runner_type
,
1
)
do
|
table
,
query
|
update_column_in_batches
(
:ci_runners
,
:runner_type
,
PROJECT_RUNNER_TYPE
)
do
|
table
,
query
|
query
.
where
(
table
[
:is_shared
].
eq
(
true
)).
where
(
table
[
:runner_type
].
eq
(
nil
))
end
update_column_in_batches
(
:ci_runners
,
:runner_type
,
3
)
do
|
table
,
query
|
update_column_in_batches
(
:ci_runners
,
:runner_type
,
INSTANCE_RUNNER_TYPE
)
do
|
table
,
query
|
query
.
where
(
table
[
:is_shared
].
eq
(
false
)).
where
(
table
[
:runner_type
].
eq
(
nil
))
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