summaryrefslogtreecommitdiff
path: root/db/post_migrate/20210226120851_move_container_registry_enabled_to_project_features.rb
diff options
context:
space:
mode:
Diffstat (limited to 'db/post_migrate/20210226120851_move_container_registry_enabled_to_project_features.rb')
-rw-r--r--db/post_migrate/20210226120851_move_container_registry_enabled_to_project_features.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/db/post_migrate/20210226120851_move_container_registry_enabled_to_project_features.rb b/db/post_migrate/20210226120851_move_container_registry_enabled_to_project_features.rb
new file mode 100644
index 00000000000..7bc7a0e49f7
--- /dev/null
+++ b/db/post_migrate/20210226120851_move_container_registry_enabled_to_project_features.rb
@@ -0,0 +1,25 @@
+# frozen_string_literal: true
+
+class MoveContainerRegistryEnabledToProjectFeatures < ActiveRecord::Migration[6.0]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ BATCH_SIZE = 50_000
+ MIGRATION = 'MoveContainerRegistryEnabledToProjectFeature'
+
+ disable_ddl_transaction!
+
+ class Project < ActiveRecord::Base
+ include EachBatch
+ self.table_name = 'projects'
+ end
+
+ def up
+ queue_background_migration_jobs_by_range_at_intervals(Project, MIGRATION, 2.minutes, batch_size: BATCH_SIZE)
+ end
+
+ def down
+ # no-op
+ end
+end