diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-18 00:16:56 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-18 00:16:56 +0300 |
commit | 0747a86c840e286a70f0eb30385ee5e79f1d3939 (patch) | |
tree | bbb999106f3a6c19a6cf6b6bfc2c26a2a70d143e /db | |
parent | 4847ec0f5040b52509876b7df47cb7a304f7a89a (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
4 files changed, 41 insertions, 23 deletions
diff --git a/db/docs/batched_background_migrations/backfill_finding_id_in_vulnerabilities.yml b/db/docs/batched_background_migrations/backfill_finding_id_in_vulnerabilities.yml index 0ecbdfb9151..aaa901d46ea 100644 --- a/db/docs/batched_background_migrations/backfill_finding_id_in_vulnerabilities.yml +++ b/db/docs/batched_background_migrations/backfill_finding_id_in_vulnerabilities.yml @@ -3,6 +3,6 @@ migration_job_name: BackfillFindingIdInVulnerabilities description: Backfills finding_id column on vulnerabilities table for a proper 1:1 relation feature_category: vulnerability_management introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/130058 -queued_migration_version: 20231116105945 -milestone: '16.4' -finalize_after: '2023-12-15' +milestone: '16.7' +queued_migration_version: 20231129105945 +finalize_after: '2024-01-15' diff --git a/db/post_migrate/20231116105945_requeue_backfill_finding_id_in_vulnerabilities2.rb b/db/post_migrate/20231116105945_requeue_backfill_finding_id_in_vulnerabilities2.rb index 7adbfe41c38..5713df95be3 100644 --- a/db/post_migrate/20231116105945_requeue_backfill_finding_id_in_vulnerabilities2.rb +++ b/db/post_migrate/20231116105945_requeue_backfill_finding_id_in_vulnerabilities2.rb @@ -3,25 +3,8 @@ class RequeueBackfillFindingIdInVulnerabilities2 < Gitlab::Database::Migration[2.2] milestone '16.7' - MIGRATION = "BackfillFindingIdInVulnerabilities" - DELAY_INTERVAL = 2.minutes - BATCH_SIZE = 1000 - SUB_BATCH_SIZE = 100 + # marking as no-op as per our database guidelines + def up; end - restrict_gitlab_migration gitlab_schema: :gitlab_main - - def up - queue_batched_background_migration( - MIGRATION, - :vulnerabilities, - :id, - job_interval: DELAY_INTERVAL, - batch_size: BATCH_SIZE, - sub_batch_size: SUB_BATCH_SIZE - ) - end - - def down - delete_batched_background_migration(MIGRATION, :vulnerabilities, :id, []) - end + def down; end end diff --git a/db/post_migrate/20231129105945_requeue_backfill_finding_id_in_vulnerabilities3.rb b/db/post_migrate/20231129105945_requeue_backfill_finding_id_in_vulnerabilities3.rb new file mode 100644 index 00000000000..8dd42dc4000 --- /dev/null +++ b/db/post_migrate/20231129105945_requeue_backfill_finding_id_in_vulnerabilities3.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +class RequeueBackfillFindingIdInVulnerabilities3 < Gitlab::Database::Migration[2.2] + milestone '16.7' + + MIGRATION = "BackfillFindingIdInVulnerabilities" + DELAY_INTERVAL = 2.minutes + BATCH_SIZE = 1000 + SUB_BATCH_SIZE = 100 + + restrict_gitlab_migration gitlab_schema: :gitlab_main + + def up + delete_batched_background_migration( + MIGRATION, + :vulnerabilities, + :id, + [] + ) + + queue_batched_background_migration( + MIGRATION, + :vulnerabilities, + :id, + job_interval: DELAY_INTERVAL, + batch_size: BATCH_SIZE, + sub_batch_size: SUB_BATCH_SIZE + ) + end + + def down + delete_batched_background_migration(MIGRATION, :vulnerabilities, :id, []) + end +end diff --git a/db/schema_migrations/20231129105945 b/db/schema_migrations/20231129105945 new file mode 100644 index 00000000000..4b3b0d220bf --- /dev/null +++ b/db/schema_migrations/20231129105945 @@ -0,0 +1 @@ +31cf08d6a1cb511a5d36ffa8633e1f2c7d5262fc5743d34f2dd5edcbedff19fa
\ No newline at end of file |