diff --git a/db/docs/batched_background_migrations/backfill_scan_result_policies_project_id.yml b/db/docs/batched_background_migrations/backfill_scan_result_policies_project_id.yml index 0c2b136fc50392dde0cb5b12e9403ca527603d39..7106059756a3be306c148bf70721d4b7b1c83839 100644 --- a/db/docs/batched_background_migrations/backfill_scan_result_policies_project_id.yml +++ b/db/docs/batched_background_migrations/backfill_scan_result_policies_project_id.yml @@ -5,4 +5,4 @@ feature_category: security_policy_management introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/183125 milestone: '17.10' queued_migration_version: 20250301125534 -finalized_by: # version of the migration that finalized this BBM +finalized_by: '20250711031222' diff --git a/db/post_migrate/20250711031222_finalize_backfill_scan_result_policies_project_id.rb b/db/post_migrate/20250711031222_finalize_backfill_scan_result_policies_project_id.rb new file mode 100644 index 0000000000000000000000000000000000000000..ef9aa6b02144d5c79cc7522e2814169420496f2e --- /dev/null +++ b/db/post_migrate/20250711031222_finalize_backfill_scan_result_policies_project_id.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +class FinalizeBackfillScanResultPoliciesProjectId < Gitlab::Database::Migration[2.3] + milestone '18.3' + disable_ddl_transaction! + + restrict_gitlab_migration gitlab_schema: :gitlab_main_cell + + def up + ensure_batched_background_migration_is_finished( + job_class_name: 'BackfillScanResultPoliciesProjectId', + table_name: :scan_result_policies, + column_name: :id, + job_arguments: [:project_id, :security_orchestration_policy_configurations, :project_id, + :security_orchestration_policy_configuration_id], + finalize: true + ) + end + + def down; end +end diff --git a/db/schema_migrations/20250711031222 b/db/schema_migrations/20250711031222 new file mode 100644 index 0000000000000000000000000000000000000000..51d8ff814944bc0780edf2a294938d3d35f211bd --- /dev/null +++ b/db/schema_migrations/20250711031222 @@ -0,0 +1 @@ +37c9b27b56354045b0d8bea53a104d3025e128a2e3d008d9c59308fa0e42af4c \ No newline at end of file