diff --git a/db/docs/batched_background_migrations/fix_allow_descendants_override_disabled_shared_runners.yml b/db/docs/batched_background_migrations/fix_allow_descendants_override_disabled_shared_runners.yml
index fc69b1eb93469a3ed3536755215c5e5dd3ad02a2..1fec979899bcb9d6ec13cb742f743d93043c51d4 100644
--- a/db/docs/batched_background_migrations/fix_allow_descendants_override_disabled_shared_runners.yml
+++ b/db/docs/batched_background_migrations/fix_allow_descendants_override_disabled_shared_runners.yml
@@ -1,6 +1,8 @@
 ---
 migration_job_name: FixAllowDescendantsOverrideDisabledSharedRunners
-description: Clears invalid combination of shared runners settings (fixes subgroup creation)
+description: Clears invalid combination of shared runners settings (fixes subgroup
+  creation)
 feature_category: runner_fleet
 introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/128112
 milestone: '16.3'
+finalized_by: '20231207221159'
diff --git a/db/post_migrate/20231207221159_finalize_fix_allow_descendants_override_disabled_shared_runners.rb b/db/post_migrate/20231207221159_finalize_fix_allow_descendants_override_disabled_shared_runners.rb
new file mode 100644
index 0000000000000000000000000000000000000000..86dead2c54e0169acb37a84f2030a8b7cf2885b5
--- /dev/null
+++ b/db/post_migrate/20231207221159_finalize_fix_allow_descendants_override_disabled_shared_runners.rb
@@ -0,0 +1,21 @@
+# frozen_string_literal: true
+
+class FinalizeFixAllowDescendantsOverrideDisabledSharedRunners < Gitlab::Database::Migration[2.2]
+  milestone '16.7'
+
+  disable_ddl_transaction!
+
+  restrict_gitlab_migration gitlab_schema: :gitlab_main
+
+  def up
+    ensure_batched_background_migration_is_finished(
+      job_class_name: 'FixAllowDescendantsOverrideDisabledSharedRunners',
+      table_name: :namespaces,
+      column_name: :id,
+      job_arguments: [],
+      finalize: true
+    )
+  end
+
+  def down; end
+end
diff --git a/db/schema_migrations/20231207221159 b/db/schema_migrations/20231207221159
new file mode 100644
index 0000000000000000000000000000000000000000..a0b072bdd4d27f6beb8ce828168751d5c7a092de
--- /dev/null
+++ b/db/schema_migrations/20231207221159
@@ -0,0 +1 @@
+2a81b952d0db20a477204dbecfeff94af3df0c1b1373eef4b5276f215f6257e9
\ No newline at end of file