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

20220405092619_toggle_vsa_aggregations_enable.rb « post_migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: da1353b5cf999cd1ec6e2a4736565cf98b05a897 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# frozen_string_literal: true

class ToggleVsaAggregationsEnable < Gitlab::Database::Migration[2.0]
  disable_ddl_transaction!

  restrict_gitlab_migration gitlab_schema: :gitlab_main

  def up
    model = define_batchable_model('analytics_cycle_analytics_aggregations')

    model.each_batch(of: 100) do |relation|
      relation.where('enabled IS FALSE').update_all(enabled: true)
    end
  end

  def down
    # noop
  end
end