Commit aedb5469 authored by Robert Speicher's avatar Robert Speicher

Correct AddDefaultOtpRequiredForLoginValue migration

Also MySQL complains when you change a field to be not null if any
existing records already have a null value, so this updates those rows.
parent d3ff8c1a
class AddDefaultOtpRequiredForLoginValue < ActiveRecord::Migration class AddDefaultOtpRequiredForLoginValue < ActiveRecord::Migration
def up 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 change_column :users, :otp_required_for_login, :boolean, default: false, null: false
end end
def down def down
change_column :users, :otp_required_for_login, :boolean, default: nil change_column :users, :otp_required_for_login, :boolean, null: true
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment