diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-04 16:53:44 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-04 16:53:44 +0000 |
commit | 4e3a54f835daa49bf784d6e6ad91e90116a24dc8 (patch) | |
tree | 8e1f7be7a80da2de02b2da0ed88f81b2f6b6de8c /db | |
parent | aefe6486cf0d193067112b90145083d73b96bfef (diff) | |
download | gitlab-ce-4e3a54f835daa49bf784d6e6ad91e90116a24dc8.tar.gz |
Add latest changes from gitlab-org/security/gitlab@13-6-stable-ee
Diffstat (limited to 'db')
-rw-r--r-- | db/post_migrate/20201109114603_schedule_remove_inaccessible_epic_todos.rb | 29 | ||||
-rw-r--r-- | db/schema_migrations/20201109114603 | 1 |
2 files changed, 30 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 diff --git a/db/schema_migrations/20201109114603 b/db/schema_migrations/20201109114603 new file mode 100644 index 00000000000..c1df2223dbd --- /dev/null +++ b/db/schema_migrations/20201109114603 @@ -0,0 +1 @@ +ae8034ec52df47ce2ce3397715dd18347e4d297a963c17c7b26321f414dfa632
\ No newline at end of file |