diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-04 19:53:44 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-04 19:53:44 +0300 |
commit | 4e3a54f835daa49bf784d6e6ad91e90116a24dc8 (patch) | |
tree | 8e1f7be7a80da2de02b2da0ed88f81b2f6b6de8c /db/post_migrate | |
parent | aefe6486cf0d193067112b90145083d73b96bfef (diff) |
Add latest changes from gitlab-org/security/gitlab@13-6-stable-ee
Diffstat (limited to 'db/post_migrate')
-rw-r--r-- | db/post_migrate/20201109114603_schedule_remove_inaccessible_epic_todos.rb | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/db/post_migrate/20201109114603_schedule_remove_inaccessible_epic_todos.rb b/db/post_migrate/20201109114603_schedule_remove_inaccessible_epic_todos.rb new file mode 100644 index 00000000000..13d12675a28 --- /dev/null +++ b/db/post_migrate/20201109114603_schedule_remove_inaccessible_epic_todos.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +class ScheduleRemoveInaccessibleEpicTodos < ActiveRecord::Migration[6.0] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + INTERVAL = 2.minutes + BATCH_SIZE = 10 + MIGRATION = 'RemoveInaccessibleEpicTodos' + + disable_ddl_transaction! + + class Epic < ActiveRecord::Base + include EachBatch + end + + def up + return unless Gitlab.ee? + + relation = Epic.where(confidential: true) + + queue_background_migration_jobs_by_range_at_intervals( + relation, MIGRATION, INTERVAL, batch_size: BATCH_SIZE) + end + + def down + # no-op + end +end |