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

20170124193205_add_two_factor_columns_to_users.rb « migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 1d1021fcbb33bce1ffb222249173b328e5da1915 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
class AddTwoFactorColumnsToUsers < ActiveRecord::Migration
  include Gitlab::Database::MigrationHelpers

  DOWNTIME = false

  disable_ddl_transaction!

  def up
    add_column_with_default(:users, :require_two_factor_authentication_from_group, :boolean, default: false)
    add_column_with_default(:users, :two_factor_grace_period, :integer, default: 48)
  end

  def down
    remove_column(:users, :require_two_factor_authentication_from_group)
    remove_column(:users, :two_factor_grace_period)
  end
end