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
5bc56715
Commit
5bc56715
authored
Aug 26, 2020
by
Imre Farkas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Move EE Base Model constant to method"
This reverts commit
7eac2cf6
.
parent
c1b1d1fa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
db/post_migrate/20200806100713_schedule_populate_resolved_on_default_branch_column.rb
...13_schedule_populate_resolved_on_default_branch_column.rb
+2
-1
No files found.
db/post_migrate/20200806100713_schedule_populate_resolved_on_default_branch_column.rb
View file @
5bc56715
...
@@ -7,13 +7,14 @@ class SchedulePopulateResolvedOnDefaultBranchColumn < ActiveRecord::Migration[6.
...
@@ -7,13 +7,14 @@ class SchedulePopulateResolvedOnDefaultBranchColumn < ActiveRecord::Migration[6.
BATCH_SIZE
=
100
BATCH_SIZE
=
100
DELAY_INTERVAL
=
5
.
minutes
.
to_i
DELAY_INTERVAL
=
5
.
minutes
.
to_i
MIGRATION_CLASS
=
'PopulateResolvedOnDefaultBranchColumn'
MIGRATION_CLASS
=
'PopulateResolvedOnDefaultBranchColumn'
BASE_MODEL
=
EE
::
Gitlab
::
BackgroundMigration
::
PopulateResolvedOnDefaultBranchColumn
::
Vulnerability
disable_ddl_transaction!
disable_ddl_transaction!
def
up
def
up
return
unless
run_migration?
return
unless
run_migration?
EE
::
Gitlab
::
BackgroundMigration
::
PopulateResolvedOnDefaultBranchColumn
::
Vulnerability
.
distinct
.
each_batch
(
of:
BATCH_SIZE
,
column: :project_id
)
do
|
batch
,
index
|
BASE_MODEL
.
distinct
.
each_batch
(
of:
BATCH_SIZE
,
column: :project_id
)
do
|
batch
,
index
|
project_ids
=
batch
.
pluck
(
:project_id
)
project_ids
=
batch
.
pluck
(
:project_id
)
migrate_in
(
index
*
DELAY_INTERVAL
,
MIGRATION_CLASS
,
project_ids
)
migrate_in
(
index
*
DELAY_INTERVAL
,
MIGRATION_CLASS
,
project_ids
)
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