diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2024-01-11 15:09:29 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2024-01-11 15:09:29 +0300 |
commit | 97feef1f73fd0a3237d1a2aef4e977e7e27ecace (patch) | |
tree | 4153af3602f242ed1a138fe70bd843a2564dab19 /db/post_migrate/20240109090354_queue_backfill_partition_id_ci_pipeline_artifact.rb | |
parent | 6f5be4b446db2f17fc0307c4fce8ae285b35d89a (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db/post_migrate/20240109090354_queue_backfill_partition_id_ci_pipeline_artifact.rb')
-rw-r--r-- | db/post_migrate/20240109090354_queue_backfill_partition_id_ci_pipeline_artifact.rb | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/db/post_migrate/20240109090354_queue_backfill_partition_id_ci_pipeline_artifact.rb b/db/post_migrate/20240109090354_queue_backfill_partition_id_ci_pipeline_artifact.rb new file mode 100644 index 00000000000..30959a299fb --- /dev/null +++ b/db/post_migrate/20240109090354_queue_backfill_partition_id_ci_pipeline_artifact.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +class QueueBackfillPartitionIdCiPipelineArtifact < Gitlab::Database::Migration[2.2] + milestone '16.8' + restrict_gitlab_migration gitlab_schema: :gitlab_ci + + MIGRATION = 'BackfillPartitionIdCiPipelineArtifact' + DELAY_INTERVAL = 2.minutes + BATCH_SIZE = 1000 + SUB_BATCH_SIZE = 100 + + def up + queue_batched_background_migration( + MIGRATION, + :ci_pipeline_artifacts, + :id, + job_interval: DELAY_INTERVAL, + batch_size: BATCH_SIZE, + sub_batch_size: SUB_BATCH_SIZE + ) + end + + def down + delete_batched_background_migration(MIGRATION, :ci_pipeline_artifacts, :id, []) + end +end |