diff --git a/db/docs/batched_background_migrations/backfill_issues_correct_work_item_type_id.yml b/db/docs/batched_background_migrations/backfill_issues_correct_work_item_type_id.yml index 734f0ec90eb1d307730eecc14a26109b1ad31541..5b8268a62454debbaa70d31bafc5a7f917d12199 100644 --- a/db/docs/batched_background_migrations/backfill_issues_correct_work_item_type_id.yml +++ b/db/docs/batched_background_migrations/backfill_issues_correct_work_item_type_id.yml @@ -5,4 +5,4 @@ feature_category: team_planning introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/167972 milestone: '17.5' queued_migration_version: 20241002185804 -finalized_by: # version of the migration that finalized this BBM +finalized_by: 20241030165330 diff --git a/db/post_migrate/20241030165330_finalize_backfill_issues_correct_work_item_type_id.rb b/db/post_migrate/20241030165330_finalize_backfill_issues_correct_work_item_type_id.rb new file mode 100644 index 0000000000000000000000000000000000000000..7762ee473426472f35f923cf3bf8316453d88353 --- /dev/null +++ b/db/post_migrate/20241030165330_finalize_backfill_issues_correct_work_item_type_id.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +class FinalizeBackfillIssuesCorrectWorkItemTypeId < Gitlab::Database::Migration[2.2] + disable_ddl_transaction! + restrict_gitlab_migration gitlab_schema: :gitlab_main + + milestone '17.6' + + MIGRATION = "BackfillIssuesCorrectWorkItemTypeId" + + def up + ensure_batched_background_migration_is_finished( + job_class_name: MIGRATION, + table_name: :issues, + column_name: :id, + job_arguments: [], + finalize: true + ) + end + + def down + # no-op + end +end diff --git a/db/schema_migrations/20241030165330 b/db/schema_migrations/20241030165330 new file mode 100644 index 0000000000000000000000000000000000000000..be978d59a01376cefbf97fca698612b33f39dfc5 --- /dev/null +++ b/db/schema_migrations/20241030165330 @@ -0,0 +1 @@ +cc3ef05bcf103ea2e3a69a450eb71be8680fd6d4aa9d6538276667003eadd24b \ No newline at end of file diff --git a/spec/lib/gitlab/background_migration/backfill_issues_correct_work_item_type_id_spec.rb b/spec/lib/gitlab/background_migration/backfill_issues_correct_work_item_type_id_spec.rb index 586bb3ae4091c365fc15c46aeb62ef16044fd00f..fc9e300350eaee4b58c5ea4bdcaf29066efa595a 100644 --- a/spec/lib/gitlab/background_migration/backfill_issues_correct_work_item_type_id_spec.rb +++ b/spec/lib/gitlab/background_migration/backfill_issues_correct_work_item_type_id_spec.rb @@ -2,7 +2,9 @@ require 'spec_helper' -RSpec.describe Gitlab::BackgroundMigration::BackfillIssuesCorrectWorkItemTypeId, feature_category: :team_planning do +RSpec.describe Gitlab::BackgroundMigration::BackfillIssuesCorrectWorkItemTypeId, + feature_category: :team_planning, + schema: 20241030165330 do let(:batch_column) { 'id' } let(:sub_batch_size) { 2 } let(:pause_ms) { 0 }