diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-03-30 02:49:08 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-03-30 02:49:18 +0300 |
commit | 38dadcee569adfbbb1c9dc99634bba4e9a9128bc (patch) | |
tree | 32661c6c5a8585196d1c84b7f4efcdc166cb8240 /db/post_migrate | |
parent | 05bbfffcd3692a70849628ff36ecb8eeac4902af (diff) |
Add latest changes from gitlab-org/security/gitlab@15-9-stable-ee
Diffstat (limited to 'db/post_migrate')
-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 |