debian-mirror-gitlab/db/post_migrate/20220405092619_toggle_vsa_aggregations_enable.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

20 lines
430 B
Ruby
Raw Normal View History

2022-07-16 23:28:13 +05:30
# 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