diff --git a/db/docs/batched_background_migrations/backfill_approvals_project_id.yml b/db/docs/batched_background_migrations/backfill_approvals_project_id.yml index 27cd0428744ee9f011c77a1c3d415c4e070ae88a..73fecd5304cb035a939b9898ea4442ae38412e05 100644 --- a/db/docs/batched_background_migrations/backfill_approvals_project_id.yml +++ b/db/docs/batched_background_migrations/backfill_approvals_project_id.yml @@ -5,4 +5,4 @@ feature_category: code_review_workflow introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/160035 milestone: '17.3' queued_migration_version: 20240719090631 -finalized_by: # version of the migration that finalized this BBM +finalized_by: '20241001232051' diff --git a/db/post_migrate/20241001232051_finalize_backfill_approvals_project_id.rb b/db/post_migrate/20241001232051_finalize_backfill_approvals_project_id.rb new file mode 100644 index 0000000000000000000000000000000000000000..7f29d61b1a3f0bb3f3660621ae4109a834e9fc4f --- /dev/null +++ b/db/post_migrate/20241001232051_finalize_backfill_approvals_project_id.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +class FinalizeBackfillApprovalsProjectId < Gitlab::Database::Migration[2.2] + milestone '17.5' + + disable_ddl_transaction! + + restrict_gitlab_migration gitlab_schema: :gitlab_main_cell + + def up + ensure_batched_background_migration_is_finished( + job_class_name: 'BackfillApprovalsProjectId', + table_name: :approvals, + column_name: :id, + job_arguments: [:project_id, :merge_requests, :target_project_id, :merge_request_id], + finalize: true + ) + end + + def down; end +end diff --git a/db/schema_migrations/20241001232051 b/db/schema_migrations/20241001232051 new file mode 100644 index 0000000000000000000000000000000000000000..660ce528a5d5b535d9420665a6d46880b1c08279 --- /dev/null +++ b/db/schema_migrations/20241001232051 @@ -0,0 +1 @@ +18a0a5880415bbc6d9b4376b4d5d9733d9d3c9f9b0ce44f0236edcc218e0402b \ No newline at end of file