2017-11-17 13:38:14 +00:00
|
|
|
# rubocop:disable Migration/UpdateLargeTable
|
2018-11-13 07:27:31 +00:00
|
|
|
class AddTwoFactorColumnsToNamespaces < ActiveRecord::Migration[4.2]
|
2017-01-24 21:09:58 +00:00
|
|
|
include Gitlab::Database::MigrationHelpers
|
|
|
|
|
|
|
|
DOWNTIME = false
|
|
|
|
|
|
|
|
disable_ddl_transaction!
|
|
|
|
|
|
|
|
def up
|
|
|
|
add_column_with_default(:namespaces, :require_two_factor_authentication, :boolean, default: false)
|
|
|
|
add_column_with_default(:namespaces, :two_factor_grace_period, :integer, default: 48)
|
|
|
|
|
|
|
|
add_concurrent_index(:namespaces, :require_two_factor_authentication)
|
|
|
|
end
|
|
|
|
|
|
|
|
def down
|
|
|
|
remove_column(:namespaces, :require_two_factor_authentication)
|
|
|
|
remove_column(:namespaces, :two_factor_grace_period)
|
|
|
|
|
2017-04-06 18:02:57 +00:00
|
|
|
remove_concurrent_index(:namespaces, :require_two_factor_authentication) if index_exists?(:namespaces, :require_two_factor_authentication)
|
2017-01-24 21:09:58 +00:00
|
|
|
end
|
|
|
|
end
|