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

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

class ConfirmSecurityBot < ActiveRecord::Migration[6.0]
  class User < ActiveRecord::Base
    self.table_name = 'users'
    SECURITY_BOT_TYPE = 8
  end

  def up
    User.where(user_type: User::SECURITY_BOT_TYPE, confirmed_at: nil)
      .update_all(confirmed_at: Time.current)
  end

  # no-op
  # Security Bot should be always confirmed
  def down
  end
end