diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-19 23:18:09 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-19 23:18:09 +0000 |
commit | 6ed4ec3e0b1340f96b7c043ef51d1b33bbe85fde (patch) | |
tree | dc4d20fe6064752c0bd323187252c77e0a89144b /db/post_migrate/20220706145113_backfill_namespace_id_on_issues.rb | |
parent | 9868dae7fc0655bd7ce4a6887d4e6d487690eeed (diff) | |
download | gitlab-ce-6ed4ec3e0b1340f96b7c043ef51d1b33bbe85fde.tar.gz |
Add latest changes from gitlab-org/gitlab@15-4-stable-eev15.4.0-rc42
Diffstat (limited to 'db/post_migrate/20220706145113_backfill_namespace_id_on_issues.rb')
-rw-r--r-- | db/post_migrate/20220706145113_backfill_namespace_id_on_issues.rb | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/db/post_migrate/20220706145113_backfill_namespace_id_on_issues.rb b/db/post_migrate/20220706145113_backfill_namespace_id_on_issues.rb new file mode 100644 index 00000000000..8114967ac8e --- /dev/null +++ b/db/post_migrate/20220706145113_backfill_namespace_id_on_issues.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +class BackfillNamespaceIdOnIssues < Gitlab::Database::Migration[2.0] + restrict_gitlab_migration gitlab_schema: :gitlab_main + disable_ddl_transaction! + + MIGRATION = 'BackfillProjectNamespaceOnIssues' + DELAY_INTERVAL = 2.minutes + BATCH_SIZE = 500 + MAX_BATCH_SIZE = 10_000 + SUB_BATCH_SIZE = 10 + + def up + queue_batched_background_migration( + MIGRATION, + :issues, + :id, + job_interval: DELAY_INTERVAL, + batch_size: BATCH_SIZE, + max_batch_size: MAX_BATCH_SIZE, + sub_batch_size: SUB_BATCH_SIZE + ) + end + + def down + delete_batched_background_migration(MIGRATION, :issues, :id, []) + end +end |