Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'db/post_migrate/20220322071127_finalize_project_namespaces_backfill.rb')
-rw-r--r--db/post_migrate/20220322071127_finalize_project_namespaces_backfill.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/db/post_migrate/20220322071127_finalize_project_namespaces_backfill.rb b/db/post_migrate/20220322071127_finalize_project_namespaces_backfill.rb
new file mode 100644
index 00000000000..5a4d14dcfb7
--- /dev/null
+++ b/db/post_migrate/20220322071127_finalize_project_namespaces_backfill.rb
@@ -0,0 +1,21 @@
+# frozen_string_literal: true
+
+# This migration acts as a gate-keeper for other migrations related to project namespace back-filling
+# so that other migrations that depend on project namespace back-filling cannot be run unless project namespace
+# back-filling has finalized successfully.
+class FinalizeProjectNamespacesBackfill < Gitlab::Database::Migration[1.0]
+ MIGRATION = 'ProjectNamespaces::BackfillProjectNamespaces'
+
+ def up
+ ensure_batched_background_migration_is_finished(
+ job_class_name: MIGRATION,
+ table_name: :projects,
+ column_name: :id,
+ job_arguments: [nil, 'up']
+ )
+ end
+
+ def down
+ # noop
+ end
+end