summaryrefslogtreecommitdiff
path: root/db/post_migrate/20210215095328_migrate_delayed_project_removal_from_namespaces_to_namespace_settings.rb
diff options
context:
space:
mode:
Diffstat (limited to 'db/post_migrate/20210215095328_migrate_delayed_project_removal_from_namespaces_to_namespace_settings.rb')
-rw-r--r--db/post_migrate/20210215095328_migrate_delayed_project_removal_from_namespaces_to_namespace_settings.rb28
1 files changed, 0 insertions, 28 deletions
diff --git a/db/post_migrate/20210215095328_migrate_delayed_project_removal_from_namespaces_to_namespace_settings.rb b/db/post_migrate/20210215095328_migrate_delayed_project_removal_from_namespaces_to_namespace_settings.rb
deleted file mode 100644
index 12e156d3b8a..00000000000
--- a/db/post_migrate/20210215095328_migrate_delayed_project_removal_from_namespaces_to_namespace_settings.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-# frozen_string_literal: true
-
-class MigrateDelayedProjectRemovalFromNamespacesToNamespaceSettings < ActiveRecord::Migration[6.0]
- DOWNTIME = false
-
- class Namespace < ActiveRecord::Base
- self.table_name = 'namespaces'
-
- include ::EachBatch
- end
-
- def up
- Namespace.select(:id).where(delayed_project_removal: true).each_batch do |batch|
- values = batch.map { |record| "(#{record.id}, TRUE, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP)" }
-
- execute <<-EOF.strip_heredoc
- INSERT INTO namespace_settings (namespace_id, delayed_project_removal, created_at, updated_at)
- VALUES #{values.join(', ')}
- ON CONFLICT (namespace_id) DO UPDATE
- SET delayed_project_removal = TRUE
- EOF
- end
- end
-
- def down
- # no-op
- end
-end