summaryrefslogtreecommitdiff
path: root/db/post_migrate/20210513163904_cleanup_move_container_registry_enabled_to_project_feature.rb
diff options
context:
space:
mode:
Diffstat (limited to 'db/post_migrate/20210513163904_cleanup_move_container_registry_enabled_to_project_feature.rb')
-rw-r--r--db/post_migrate/20210513163904_cleanup_move_container_registry_enabled_to_project_feature.rb36
1 files changed, 0 insertions, 36 deletions
diff --git a/db/post_migrate/20210513163904_cleanup_move_container_registry_enabled_to_project_feature.rb b/db/post_migrate/20210513163904_cleanup_move_container_registry_enabled_to_project_feature.rb
deleted file mode 100644
index 665d274a0ee..00000000000
--- a/db/post_migrate/20210513163904_cleanup_move_container_registry_enabled_to_project_feature.rb
+++ /dev/null
@@ -1,36 +0,0 @@
-# frozen_string_literal: true
-
-class CleanupMoveContainerRegistryEnabledToProjectFeature < ActiveRecord::Migration[6.0]
- MIGRATION = 'MoveContainerRegistryEnabledToProjectFeature'
-
- disable_ddl_transaction!
-
- def up
- Gitlab::BackgroundMigration.steal(MIGRATION)
-
- bg_migration_job_class = define_background_migration_jobs_class
- bg_migration_job_class.where(class_name: MIGRATION, status: bg_migration_job_class.statuses['pending']).each do |job|
- Gitlab::BackgroundMigration::MoveContainerRegistryEnabledToProjectFeature.new.perform(*job.arguments)
- end
-
- bg_migration_job_class.where(class_name: MIGRATION).delete_all
- end
-
- def down
- # no-op
- end
-
- private
-
- def define_background_migration_jobs_class
- Class.new(ActiveRecord::Base) do
- self.table_name = 'background_migration_jobs'
- self.inheritance_column = :_type_disabled
-
- enum status: {
- pending: 0,
- succeeded: 1
- }
- end
- end
-end