diff options
author | GitLab Release Tools Bot <delivery-team+release-tools@gitlab.com> | 2023-03-30 20:51:15 +0000 |
---|---|---|
committer | GitLab Release Tools Bot <delivery-team+release-tools@gitlab.com> | 2023-03-30 20:51:15 +0000 |
commit | f4653343ad8475d1d72a55de4face443cc7f66c2 (patch) | |
tree | c9c9ebb914be91d9c5996f708721110276a38be1 /db/post_migrate/20230208131808_nullify_last_error_from_project_mirror_data.rb | |
parent | 096459e2c2c8e3c17eb6e677091990adffe9af7d (diff) | |
parent | a2b7634113a2b2f3b9aad86b1a98c52c380e5e76 (diff) | |
download | gitlab-ce-f4653343ad8475d1d72a55de4face443cc7f66c2.tar.gz |
Merge remote-tracking branch 'dev/15-10-stable' into 15-10-stable
Diffstat (limited to 'db/post_migrate/20230208131808_nullify_last_error_from_project_mirror_data.rb')
-rw-r--r-- | db/post_migrate/20230208131808_nullify_last_error_from_project_mirror_data.rb | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/db/post_migrate/20230208131808_nullify_last_error_from_project_mirror_data.rb b/db/post_migrate/20230208131808_nullify_last_error_from_project_mirror_data.rb new file mode 100644 index 00000000000..73e6f257498 --- /dev/null +++ b/db/post_migrate/20230208131808_nullify_last_error_from_project_mirror_data.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +class NullifyLastErrorFromProjectMirrorData < Gitlab::Database::Migration[2.1] + MIGRATION = 'NullifyLastErrorFromProjectMirrorData' + INTERVAL = 2.minutes + BATCH_SIZE = 10_000 + SUB_BATCH_SIZE = 1_000 + + disable_ddl_transaction! + restrict_gitlab_migration gitlab_schema: :gitlab_main + + def up + queue_batched_background_migration( + MIGRATION, + :project_mirror_data, + :id, + job_interval: INTERVAL, + batch_size: BATCH_SIZE, + sub_batch_size: SUB_BATCH_SIZE + ) + end + + def down + delete_batched_background_migration(MIGRATION, :project_mirror_data, :id, []) + end +end |