diff --git a/db/docs/batched_background_migrations/backfill_missing_organization_id_on_ci_runner_machines.yml b/db/docs/batched_background_migrations/backfill_missing_organization_id_on_ci_runner_machines.yml index 27b9dfcc93de42f20946b25f8fad882c9a733169..b15a2cacd6a6404f06ac597448bc6f84239f2905 100644 --- a/db/docs/batched_background_migrations/backfill_missing_organization_id_on_ci_runner_machines.yml +++ b/db/docs/batched_background_migrations/backfill_missing_organization_id_on_ci_runner_machines.yml @@ -1,11 +1,13 @@ --- migration_job_name: BackfillMissingOrganizationIdOnCiRunnerMachines -description: > - Backfill organization_id column for machines associated with non-instance type runners with default organization id. - This is the second attempt to initialize the values that were missed in a time window just after - BackfillOrganizationIdOnCiRunnerMachines was started. +description: 'Backfill organization_id column for machines associated with non-instance + type runners with default organization id. This is the second attempt to initialize + the values that were missed in a time window just after BackfillOrganizationIdOnCiRunnerMachines + was started. + + ' feature_category: fleet_visibility introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/195123 milestone: '18.2' queued_migration_version: 20250620094653 -finalized_by: # version of the migration that finalized this BBM +finalized_by: '20250717233115' diff --git a/db/post_migrate/20250717233115_finalize_hk_backfill_missing_organization_id_on_ci_runner_machines.rb b/db/post_migrate/20250717233115_finalize_hk_backfill_missing_organization_id_on_ci_runner_machines.rb new file mode 100644 index 0000000000000000000000000000000000000000..7b3a377e21de4884454f36c813f87550d3b9af9e --- /dev/null +++ b/db/post_migrate/20250717233115_finalize_hk_backfill_missing_organization_id_on_ci_runner_machines.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +class FinalizeHkBackfillMissingOrganizationIdOnCiRunnerMachines < Gitlab::Database::Migration[2.3] + milestone '18.3' + + disable_ddl_transaction! + + restrict_gitlab_migration gitlab_schema: :gitlab_ci + + def up + ensure_batched_background_migration_is_finished( + job_class_name: 'BackfillMissingOrganizationIdOnCiRunnerMachines', + table_name: :ci_runner_machines, + column_name: :id, + job_arguments: [], + finalize: true + ) + end + + def down; end +end diff --git a/db/schema_migrations/20250717233115 b/db/schema_migrations/20250717233115 new file mode 100644 index 0000000000000000000000000000000000000000..1ff62bcb3f08e73289fe481567b87569f0ab6540 --- /dev/null +++ b/db/schema_migrations/20250717233115 @@ -0,0 +1 @@ +633e5f182e42a7ca13441d70614ad74ce7574d73b1dfb61f49036b5873fa7f05 \ No newline at end of file