summaryrefslogtreecommitdiff
path: root/db/post_migrate/20210302074524_backfill_namespace_statistics_with_wiki_size.rb
diff options
context:
space:
mode:
Diffstat (limited to 'db/post_migrate/20210302074524_backfill_namespace_statistics_with_wiki_size.rb')
-rw-r--r--db/post_migrate/20210302074524_backfill_namespace_statistics_with_wiki_size.rb29
1 files changed, 0 insertions, 29 deletions
diff --git a/db/post_migrate/20210302074524_backfill_namespace_statistics_with_wiki_size.rb b/db/post_migrate/20210302074524_backfill_namespace_statistics_with_wiki_size.rb
deleted file mode 100644
index e04f69f4206..00000000000
--- a/db/post_migrate/20210302074524_backfill_namespace_statistics_with_wiki_size.rb
+++ /dev/null
@@ -1,29 +0,0 @@
-# frozen_string_literal: true
-
-class BackfillNamespaceStatisticsWithWikiSize < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
- DELAY_INTERVAL = 2.minutes.to_i
- BATCH_SIZE = 500
- MIGRATION = 'PopulateNamespaceStatistics'
-
- disable_ddl_transaction!
-
- def up
- return unless Gitlab.ee?
-
- groups = exec_query <<~SQL
- SELECT group_wiki_repositories.group_id
- FROM group_wiki_repositories
- SQL
-
- groups.rows.flatten.in_groups_of(BATCH_SIZE, false).each_with_index do |group_ids, index|
- migrate_in(index * DELAY_INTERVAL, MIGRATION, [group_ids, [:wiki_size]])
- end
- end
-
- def down
- # No-op
- end
-end