diff options
-rw-r--r-- | db/migrate/20150620233230_add_default_otp_required_for_login_value.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/db/migrate/20150620233230_add_default_otp_required_for_login_value.rb b/db/migrate/20150620233230_add_default_otp_required_for_login_value.rb index c209fa4e80f..8eed8678b2f 100644 --- a/db/migrate/20150620233230_add_default_otp_required_for_login_value.rb +++ b/db/migrate/20150620233230_add_default_otp_required_for_login_value.rb @@ -1,9 +1,11 @@ class AddDefaultOtpRequiredForLoginValue < ActiveRecord::Migration def up + execute %q{UPDATE users SET otp_required_for_login = FALSE WHERE otp_required_for_login IS NULL} + change_column :users, :otp_required_for_login, :boolean, default: false, null: false end def down - change_column :users, :otp_required_for_login, :boolean, default: nil + change_column :users, :otp_required_for_login, :boolean, null: true end end |