diff --git a/db/docs/batched_background_migrations/backfill_audit_events_streaming_event_type_filters_group_id.yml b/db/docs/batched_background_migrations/backfill_audit_events_streaming_event_type_filters_group_id.yml index 021c4886479c07b297c9d4049226347a9b028ef0..085c17493b5ad6407c583fd0e6ca82ab3582fc38 100644 --- a/db/docs/batched_background_migrations/backfill_audit_events_streaming_event_type_filters_group_id.yml +++ b/db/docs/batched_background_migrations/backfill_audit_events_streaming_event_type_filters_group_id.yml @@ -1,8 +1,9 @@ --- migration_job_name: BackfillAuditEventsStreamingEventTypeFiltersGroupId -description: Backfills sharding key `audit_events_streaming_event_type_filters.group_id` from `audit_events_external_audit_event_destinations`. +description: Backfills sharding key `audit_events_streaming_event_type_filters.group_id` + from `audit_events_external_audit_event_destinations`. feature_category: audit_events introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/152957 milestone: '17.1' queued_migration_version: 20240514140027 -finalized_by: # version of the migration that finalized this BBM +finalized_by: '20241024232152' diff --git a/db/post_migrate/20241024232152_finalize_backfill_audit_events_streaming_event_type_filters_group_id.rb b/db/post_migrate/20241024232152_finalize_backfill_audit_events_streaming_event_type_filters_group_id.rb new file mode 100644 index 0000000000000000000000000000000000000000..0a7ef1e4d9926cd250ce8c9e7fb672fbe3ba785e --- /dev/null +++ b/db/post_migrate/20241024232152_finalize_backfill_audit_events_streaming_event_type_filters_group_id.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +class FinalizeBackfillAuditEventsStreamingEventTypeFiltersGroupId < Gitlab::Database::Migration[2.2] + milestone '17.6' + + disable_ddl_transaction! + + restrict_gitlab_migration gitlab_schema: :gitlab_main_cell + + def up + ensure_batched_background_migration_is_finished( + job_class_name: 'BackfillAuditEventsStreamingEventTypeFiltersGroupId', + table_name: :audit_events_streaming_event_type_filters, + column_name: :id, + job_arguments: [:group_id, :audit_events_external_audit_event_destinations, :namespace_id, + :external_audit_event_destination_id], + finalize: true + ) + end + + def down; end +end diff --git a/db/schema_migrations/20241024232152 b/db/schema_migrations/20241024232152 new file mode 100644 index 0000000000000000000000000000000000000000..b729de15cf3bb3889c93d18dbcc6543f406ecbba --- /dev/null +++ b/db/schema_migrations/20241024232152 @@ -0,0 +1 @@ +66d71716ae0d9d2c05deb4c9dd8636d9edd6dcd4173ebb06c5f8b7af8c0ca3cd \ No newline at end of file